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 |
M-x goto-line | go to 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-/ | auto complete |
M-q | fill paragraph (useful for wrapping lines in comments) |
C-x C-f | find file (open in 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-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 |
M-x grep <RET> search_string file_name1 file_name2 ... | search for search_string in the specified files (note the files do not have to be currently open) |
M-x grep <RET> search_string * | search for search_string in all files in the current directory |
C-x ` | select next search_string in grep buffer |
M-x compile | run compile command in other window |
C-x ` | select next error in compile buffer |
M-x shell | open shell in this window |
M-p | previous command (while cursor is at the command prompt in the shell |
C-c C-c | kill currently running program (while in the shell |
The following can be put in the ~/.emacs.d/init.el file to configure Emacs
(set-face-attribute 'default nil :height FONT_SIZE) | Where FONT_SIZE is the initial font size of Emacs window times ten. |
(setq default-frame-alist '((width . CHARS_WIDE) (height . CHARS_HIGH))) | Where CHARS_WIDE and CHARS_HIGH are the initial dimensions of Emacs windows in terms of characters. |