Emacs Cheat Sheet
These are the most commonly used key bindings for Emacs. Here is the notation:
- C-x means hold Ctrl down and press x;
- C-x k means do C-x first, release all, then press k.
- C-x C-f means do C-x, release x only, then press f.
- M-x means hold Alt (or Option) down and press x;
- M-x "grep" means do M-x first, release, then type grep.
- a buffer in Emacs is the equivalent of a tab in a web browser.
Keyboard Shortcut | Emacs Action |
---|---|
F12 | open M2 in a buffer |
F11 (or F9 on macOS) | send line/section to M2 |
C-x C-f [filename] | open or create a file |
C-x C-s | save the current file |
C-x C-c | close Emacs |
C-x k | close (kill) a buffer |
M-TAB | auto-complete the word |
C-Shift-Underscore | undo! |
C-x-Plus | zoom in |
C-x-Minus | zoom out |
C-g C-g | GET ME OUT OF HERE!! |
And here are slightly fancier bindings which are nevertheless quite useful.
C-x [right/left arrow] | rotate among open buffers |
C-x 2 | split buffer horizontally |
C-x 3 | split buffer vertically |
C-x 0 | merge buffer splitting |
C-x o | switch to another buffer |
C-u F12 [path to M2] | change the command that runs M2 |
M-x "eshell" | open a shell inside Emacs |
M-x "set-input-method" | enable typing $\TeX$ in Emacs |
M-x "xterm-mouse-mode" | re-enable mouse inside Emacs |
Extended Reference Card
For many more key bindings and notation, see this reference card.