Moving the Cursor
| Forward one character |
C-f |
| Forward one word |
M-f |
| To the end of the line |
C-e |
| Backward one character |
C-b |
| Backward one word |
M-b |
| To the beginning of the line |
C-a |
| Up one line |
C-p |
| Down one line |
C-n |
| Go to line number n |
M-x goto-line n |
| Display current line number |
M-x what-line |
Paging Through Text
| Forward one screen |
C-v |
| Backward one word |
M-v |
| To the end of the file |
M-> |
| To the beginning of the file |
M-< |
| Redraw screen |
C-l |
Modifying Text
| Delete the character before the cursor |
<Backspace> |
| Delete the character under the cursor | C-d |
| Kill the word before the cursor | M-<Backspace> |
| Kill the next word after the cursor | M-d |
| Kill to the end of the line | C-k |
| Kill to the beginning of the line | C-x
<Delete> |
| Kill to the end of the current sentence | M-k |
| Kill to the beginning of the current sentence | C-x
<Backspace> |
Recovering Text (Yanking)
| Yank back the last thing killed | C-y |
| Yank back previous text | M-y |
Replacing Text
| Replace foo with
bar | M-x replace-string foo bar |
| Query replacement... | M-x
query replace |
| .. then replace | <space> |
| .. then skip to next | <Backspace> |
| .. then replace and exit | <period> |
| .. then replace all | ! |
| .. then go back | ^ |
| .. then exit query | <Esc> |
Inserting Text
| Scan file fn | M-x view-file
fn |
| Write buffer to file fn | M-x
write-file fn |
| Insert file fn text into the buffer | M-x
insert-file fn |
| Write region to file fn | M-x
write-region fn |
| Write region to the end of file fn |
M-x
write-region fn |
| Write region to the beginning of a specified buffer |
M-x
prepend-to-buffer |
Directory Operations
| Display verbose directory | C-x
d |
| Display concise directory | C-x
C-d |
| Find a file | C-x C-f |
Help
| Enter help system | C-h |
| Run help terminal | C-h
t |
| Remove help window | C-x
1 |
| Scroll help window | M-C-v |
| Show command apropos | C-h
a |
| Show function of a key | C-h
c |
| Describe a function | C-h
f |
| Get mode-specific information | C-h
m |