Unix Manuals

emacs reference

Cursor Movement and Location

This reference guide lists the commands available within GNU Emacs for moving the cursor, and reporting its location.

NOTICE - New forum for all UNIX learners, users and programmers - click here

arrow keys (if available) N/A Move cursor.
C-a beginning-of-line Move to beginning of line.
C-e end-of-line Move to end of line.
C-f forward-char Move forward one character.
C-b backward-char Move backward one character.
M-f  forward-word Move forward one word.
M-b backward-word Move backward one word.
C-n next-line Move down a line (creating the next line, if necessary).
C-p previous-line Move up a line.
M-r move-to-window-line Move to left margin, vertically centered in window.
M-< beginning-of-buffer Move to top of buffer.
M-> end-of-buffer Move to end of buffer.
M-x goto-char goto-char Read a number and go to that buffer position (start = 1).
M-x goto-line goto-line Read a number and go to that line (first line = 1).
C-x C-n set-goal-column Set current column as 'goal column'.  From then on, the C-n and C-p commands jump to that column, or the nearest possible column.
C-u C-x C-n N/A Cancel the 'goal column', and return to normal behaviour.
M-x what-page what-page Display page number and line number (within page) of cursor location.
M-x what-line what-line Display line number (within buffer) of cursor location.
M-x line-number-mode line-number-mode Display line number automatically (toggle).
M-= count-lines-region Print number of lines in current region.
C-x = what-cursor-postition Print character code, character position and column of the cursor location.