Next: , Previous: , Up: Basic Commands   [Contents][Index]


2.1 Motion Commands

There is a fairly small number of basic commands for moving around in the buffer. While there are many other more complex motion commands, these are by far the most commonly used and the easiest to learn.

Command: Forward Character (bound to C-f, Rightarrow)
Command: Backward Character (bound to C-b, Leftarrow)

Forward Character moves the point forward by one character. If a prefix argument is supplied, then the point is moved by that many characters. Backward Character is identical, except that it moves the point backwards.

Command: Forward Word (bound to M-f)
Command: Backward Word (bound to M-b)

These commands move the point forward and backward over words. The point is always left between the last word and first non-word character in the direction of motion. This means that after moving backward the cursor appears on the first character of the word, while after moving forward, the cursor appears on the delimiting character. Supplying a prefix argument moves the point by that many words.

Command: Next Line (bound to C-n, Downarrow)
Command: Previous Line (bound to C-p, Uparrow)
Command: Goto Absolute Line

Next Line and Previous Line move to adjacent lines, while remaining the same distance within a line. Note that this motion is by logical lines, each of which may take up many lines on the screen if it wraps. If a prefix argument is supplied, then the point is moved by that many lines.

The position within the line at the start is recorded, and each successive use of C-p or C-n attempts to move the point to that position on the new line. If it is not possible to move to the recorded position because the line is shorter, then the point is left at the end of the line.

Goto Absolute Line moves to the indicated line, as if you counted them starting at the beginning of the buffer with number one. If the user supplies a prefix argument, it is the line number; otherwise, Hemlock prompts the user for the line.

Command: End of Line (bound to C-e)
Command: Beginning of Line (bound to C-a)

End of Line moves the point to the end of the current line, while Beginning of Line moves to the beginning. If a prefix argument is supplied, then the point is moved to the end or beginning of the line that many lines below the current one.

Command: Scroll Window Down (bound to C-v)
Command: Scroll Window Up (bound to M-v)

Scroll Window Down moves forward in the buffer by one screenful of text, the exact amount being determined by the size of the window. If a prefix argument is supplied, then this scrolls the screen that many lines. When this action scrolls the line with the point off the screen, it this command moves the point to the vertical center of the window. Scroll Window Up is identical to Scroll Window Down, except that it moves backwards.

Hemlock Variable: Scroll Overlap (initial value 2)

This variable is used by Scroll Window Down and Scroll Window Up to determine the number of lines by which the new and old screen should overlap.

Command: End of Buffer (bound to M-<)
Command: Beginning of Buffer (bound to M->)

These commands are used to conveniently get to the very beginning and end of the text in a buffer. Before the point is moved, its position is saved by pushing it on the mark stack (see page marks).

Command: Top of Window (bound to M-,)
Command: Bottom of Window (bound to M-.)

Top of Window moves the point to the beginning of the first line displayed in the current window. Bottom of Window moves to the beginning of the last line displayed.


Next: The Mark and The Region, Previous: Basic Commands, Up: Basic Commands   [Contents][Index]