Below is an abbreviated emacs command reference. This is by no means
an exhaustive list. A slightly more complete list is
here.
You can get better at emacs by doing the emacs tutorial, by pressing
C-h t
.
C-x C-f | find file (open in current buffer) |
C-x C-s | save contents of current buffer |
C-x C-c | kill (close) Emacs |
C-x s | save all buffers |
C-x C-w | save current buffer with specified name |
C-x k | kill (close) current buffer |
C-x C-b | list existing buffers |
C-x b | select buffer by name |
C-x 2 | split current window in two vertically |
C-x 3 | split current window in two horizontally |
C-x 0 | delete the current window |
C-x 1 | delete all windows but the current |
C-x o | switch to other window |
C-M-v | scroll other window down |
C-f | move cursor forward |
C-b | move cursor backward |
C-n | move cursor to next line |
C-p | move cursor to previous line |
M-f | move cursor forward one token |
M-b | move cursor backward one token |
C-l | center screen on cursor |
C-a | move cursor to beginning of line |
C-e | move cursor to end of line |
C-v | move down one screenful |
M-v | move cursor up one screenful |
M-< | move cursor to beginning of buffer |
M-> | move cursor to end of buffer |
M-x goto-line | go to line |
M-a | move cursor to beginning of statement |
M-e | move cursor to end of statement |
M C-a | move cursor to beginning of function |
M C-e | move cursor to end of function |
C-<SPC> | set mark (mark is the beggining of region; cursor is end of region) |
C-x C-p | set region to entire uffer |
C-k | kill (cut) from cursor to end of line |
C-w | kill (cut) region |
M-w | save (copy) region |
C-y | yank (paste) what was most recently killed |
M-y | yank-pop (cycle though) earlier kills, after yanking |
<Backspace> | delete character before cursor |
C-d | delete character at cursor |
M-<Backspace> | delete from cursor to beginning of token |
M-d | delete from cursor to end of token |
M-\ | delete horizontal space |
M-; | comment/un-comment region |
<TAB> | indent line |
C-c > | indent region |
C-c < | exdent region |
C-/ | undo |
M-/ | auto complete |
M-q | fill paragraph (useful for wrapping lines in comments) |
C-s | forward incremental search |
C-r | reverse incremental search |
<RET> (when in search mode) | stop searching |
C-g (when in search mode) | cancel search and return to where search started |
M-y (when in search mode) | yank most recent kill into seach string |
M-% search_string <RET> replace_string <RET> | query replace occurances of search_string with replace_string |
y (when in query replace mode) | replace highlighted search_string |
<SPACE> (when in query replace mode) | do not replace highlighted search_string |
q (when in query replace mode) | exit query replace mode |