Emacs keys

From Jens' Hjørne
Revision as of 11:20, 9 March 2015 by Jens (talk | contribs)
Jump to navigation Jump to search

Links to check

Movement

    Forward   Backward
Unit   Key   Function   Key   Function
Character   C-f   Move one character forward   C-b   Move one character backward
Word   M-f   Move one word forward   M-b   Move one word backward
Line   C-n   Move to next line   C-p   Move to previous line
Line   C-e   Move to end of line   C-a   Move to beginning of line
Sentence   M-e   Move forward to end of sentence   M-a   Move back to beginning of sentence
Document   M->   Move to the end of the document   M-<   Move to the start of the document

Editing

Key   Function
<DelBack>   BackSpace - Delete character just before cursor
C-d   Delete next character after the cursor
M-<DelBack>   Kill word before cursor
M-d   Kill word after the cursor
C-k   Kill to end of line (not including the newline). When given a count parameter C-k will kill to end of line including the newline for each count.
M-k   Kill to end of sentence
C-@   Set mark
C-Spc   Set mark
C-w   Kill from set mark to just before cursor position
C-y   Yank back killed text at current cursor position. M-y will then cycle through earlier killed texts.

File handling, buffers and exiting

Key   Function
C-x C-f   find (open or create) file (prompted for filename)
C-x C-s   save file
C-x C-w   save file as ...
C-x s   save all files
C-x C-c   save files, exit emacs
C-x k   kill current buffer
C-x b   move to or create another buffer (prompt for buffer name)
C-x C-b   show buffer list
C-x i   insert file at cursor position

Various

Key   Function
C-u   Repeat count for command.
Alternate: Hold M while typing count.
C-v and M-V scrolls by that many lines when given a repeat count
C-g   Abort command or repeat count
C-x 1   Back to one window
C-h k <key>   Get help on key


L453