From WikEmacs
Revision as of 15:52, 30 March 2012 by GregLucas (talk | contribs) (Navigating Text buffers)
Jump to: navigation, search

Navigating Text Buffers

For navigating a buffer while editing text use the following.

Key bindings for navigating text
Entity % Movement Begin (Backward) End (Forward) Mark Kill Or Cut
Character [ C-b] [ C-f] [ C-@] [ C-d]
Word [ M-b] [ M-f] [ M-@] [ M-d]
Line [ C-a] [ C-e] [ C-k]
Sentence [ M-a] [ M-e] [ M-k]
Paragraph [ M-{ ] [ M-} ] [ M-h ] [ M-h C-w]
Page [ C-x [ ] [ C-x ] ] [ C-x C-p]


By default Emacs expects two spaces between sentences. If you prefer to use a single space try M-x customize-variable RET sentence-end-double-space.
By default Emacs expects a blank line between paragraphs.
In "*.el" files and other text files (for example the NEWS file, [C-h n]), text is divided into "pages" delimited by `^L' character. This character can be entered with [C-q C-l]

Navigating Source Code

For navigating source code (see Programming languages) use the following.

Key bindings for navigating code
Entity % Movement Begin (Backward) End (Forward) Mark Kill Or Cut Up
sexp [ C-M-b] [ C-M-f] [ C-M-@] [ C-M-k] [ C-M-u]
defun [ C-M-a] [ C-M-e] [ C-M-h] - -


These are balanced expressions. For example, in C a block enclosed in a pair of {,} and in Lisp a pair of (, ).
A Lisp function definition.
The use of CamelCaseIdentifiers is common in some programming languages. You can enable subword-mode to use the standard word-based commands to navigate subwords delimited by capital letters.