Difference between revisions of "Navigation"

From WikEmacs
Jump to navigation Jump to search
(Undo revision 2985 by 141.142.223.33 (talk))
 
(11 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
== Navigating Text Buffers ==
  
 
+
For navigating a buffer while editing text use the following.
= Navigation =
 
; Sentence : ''Remember'' You need to put two spaces after the full-stop.
 
; Page : In "*.el" files and other text files (for example {{Keys|C-h n}}), text is divided into "pages" delimited by `^L' character. This character can be entered with {{Keys|C-q C-l}}
 
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 12: Line 10:
 
! End (Forward)
 
! End (Forward)
 
! Mark
 
! Mark
! Kill
+
! Kill Or Cut
 
|-
 
|-
| ''Character''
+
!Character
 
| {{Keys | C-b}}
 
| {{Keys | C-b}}
 
| {{Keys | C-f}}
 
| {{Keys | C-f}}
Line 20: Line 18:
 
| {{Keys | C-d}}
 
| {{Keys | C-d}}
 
|-
 
|-
| ''Word''
+
!Word
 
| {{Keys | M-b}}
 
| {{Keys | M-b}}
 
| {{Keys | M-f}}
 
| {{Keys | M-f}}
Line 26: Line 24:
 
| {{Keys | M-d}}
 
| {{Keys | M-d}}
 
|-
 
|-
| ''Line''
+
!Line
 
| {{Keys | C-a}}
 
| {{Keys | C-a}}
 
| {{Keys | C-e}}
 
| {{Keys | C-e}}
Line 32: Line 30:
 
| {{Keys | C-k}}
 
| {{Keys | C-k}}
 
|-
 
|-
| ''Sentence''
+
!Sentence
 
| {{Keys | M-a}}
 
| {{Keys | M-a}}
 
| {{Keys | M-e}}
 
| {{Keys | M-e}}
Line 38: Line 36:
 
| {{Keys | M-k}}
 
| {{Keys | M-k}}
 
|-
 
|-
| ''Paragraph''
+
! Paragraph
 
| {{Keys | M-{ }}
 
| {{Keys | M-{ }}
 
| {{Keys | M-} }}
 
| {{Keys | M-} }}
Line 44: Line 42:
 
| {{Keys | {{Keys | M-h C-w}}
 
| {{Keys | {{Keys | M-h C-w}}
 
|-
 
|-
| ''Page''
+
! Page
 
| {{Keys | C-x [ }}  
 
| {{Keys | C-x [ }}  
 
| {{Keys | C-x ] }}
 
| {{Keys | C-x ] }}
Line 50: Line 48:
 
|  
 
|  
 
|}
 
|}
 +
 +
=== Notes ===
 +
 +
; Sentence : By default Emacs expects two spaces between sentences. If you prefer to use a single space try {{CustomizeVariable|sentence-end-double-space}}.
 +
; Paragraph : By default Emacs expects a blank line between paragraphs.
 +
; Page : In "*.el" files and other text files (for example the <tt>NEWS</tt> file, {{Keys|C-h n}}), text is divided into "pages" delimited by `^L' character.  This character can be entered with {{Keys|C-q C-l}}
 +
 +
 +
== Navigating Source Code ==
 +
 +
For navigating source code (see [[:Category:Programming languages|Programming languages]]) use the following.
 +
 +
{| class="wikitable"
 +
|+ Key bindings for navigating code
 +
|-
 +
! Entity % Movement
 +
! Begin (Backward)
 +
! End (Forward)
 +
! Mark
 +
! Kill Or Cut
 +
! Up
 +
|-
 +
! sexp
 +
| {{Keys | C-M-b}}
 +
| {{Keys | C-M-f}}
 +
| {{Keys | C-M-@}}
 +
| {{Keys | C-M-k}}
 +
| {{Keys | C-M-u}}
 +
|-
 +
! defun
 +
| {{Keys | C-M-a}}
 +
| {{Keys | C-M-e}}
 +
| {{Keys | C-M-h}}
 +
| {{Keys | C-M-h C-w}}
 +
|
 +
|-
 +
|}
 +
 +
=== Notes ===
 +
; sexp
 +
: These are balanced expressions. For example, in [[C]] a block enclosed in a pair of '''{''','''}''' and in [[:Category:Lisp|Lisp]] a pair of '''(''', ''')'''.
 +
; defun
 +
: A Lisp function definition.
 +
; subword : The use of <tt>CamelCaseIdentifiers</tt> is common in some programming languages. You can enable {{ModeLink|subword-mode}} to use the standard word-based commands such as {{Keys|M-f}} and {{Keys|M-b}} to navigate subwords delimited by capital letters.
 +
 +
 +
[[Category:Beginner]]

Latest revision as of 09:39, 27 May 2013

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]

Notes

Sentence
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.
Paragraph
By default Emacs expects a blank line between paragraphs.
Page
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] [ C-M-h C-w]

Notes

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