In the table and descriptions below the modifier M refers to the escape key. The M is used for Meta, a modifier on the computer keyboards used when emacs was first developed. The modifier C refers to the control key. For example, M-x replace-string means "press escape, then x" in the command mini-buffer the prompt M-x will appear, type replace-string in the mini-buffer. As another example, C-x c means "press the control key and the x key at the same time, then press the c key".
Note that M, or escape, is pressed before another key whereas C, or control, is pressed at the same time as a key. You can press the escape key directly, but C-[ is an abbreviation for escape (it doesn't require stretching your pinky a long way to get to the escape key).
At any point you can find all the bindings in effect by typing
C-h b(that's help + b as in bindings)
key combination | functionality |
---|---|
C-d | delete character to right of cursor (current char) |
M-d | delete one word to right of cursor |
C-w | kill current region (between point and mark) |
M-w | copy current region (often yanked next) |
C-x u | undo |
M-f | move forward one word at a time |
M-b | move backward one word at a time |
M-< | move to top of buffer |
M-> | move to bottom of buffer |
C-x C-s | save current buffer |
C-k | kill from cursor to end of line |
C-y | yank-back (paste) last killed thing |
M C-q | With the cursor on a left-curly brace automagically indent everything to the matching brace. |
M-/ | auto-complete the identifier you've started to type |
key combination | functionality |
---|---|
C-x s | visit all buffers, prompt to save if changed |
C-x c | compile current buffer. (this is potential trouble, note that C-x C-c quits emacs). |
C-x C-c | quit emacs (prompt to save modified buffers) |
C-s | search for a string forwards (enter string in mini-buffer) |
C-s C-s | repeats the last search (no prompt) |
C-r | search backwards in buffer (enter string in mini-buffer) |