Emacs Quick Reference

The following reference guide is by no means all-inclusive, but is meant to aid the beginning user in navigating the keystroke-intensive Emacs program.

NOTE: The abbreviation C- refers to holding down the <Control> key while pressing what follows, while the abbreviation ESC- refers to pressing the ESC key and what follows.

Quick Reference

Point Movement

C-f Move point forward one character.
C-b Move point backward one character.
C-p Move point to previous line.
C-n Move point to next line.
C-a Move point to beginning of current line.
C-e Move point to end of current line.
Esc-f Move point forward one word.
Esc-b Move point backwards one word.
C-v Move down one screen.
Esc-v Move up one screen.
Esc-< Move point to start of current buffer.
Esc-> Move point to end of current buffer.

NOTE: In addition to these keys, standard keys, such
as <left>, <right>, <up>, <down>,
<Page-Up>, and <Page-Down> can also be used to move the
point cursor on most terminals

Marking The Point

C-@ Mark the current point location (also performed by C-<SpaceBar>).
C-x h Mark entire buffer as the region, with mark at end and place point at start.

Editing Commands

C-k Delete the current line to the right.
C-w Delete the current region.
ESC-w Copy a region.
C-y Yank (paste) the last region or set of lines deleted at the current point.
C-d Delete next character.
Esc-d Kill next word (can be yanked back).
Esc-DEL Kill previous word.

File Commands

C-x C-s Save file but do not quit Emacs.
C-x C-c Quit Emacs, giving option to save if there are unsaved changes.
C-x C-w Write file, option to change the filename.
C-x i Insert a file at the current point.
C-x C-f Edit another file.

Buffer and Screen Commands

C-l Refresh the screen.
C-v Move down a screen.
ESC-v Move up a screen.
C-x 2 Split the screen
vertically into two windows.
C-x 3 Split the screen
horizontally into two windows.
C-x o Move to the other window.
C-x 1 Fill screen with current window.
C-x 0 Delete currently selected window.
C-x C-b List all of the current buffers.
C-x b Switch to buffer (Emacs prompts for the buffer’s name).
ESC-x shell Start a UNIX shell in the current buffer.

Search and Replace

C-s Search forward; pushing C-s again Searches for the next occurrence.
C-r Search backward; pushing C-r again searches for the next occurrence.
C-g Cancel the current search or go back to previously found search item if search was done again.
ESC-x replace string Replaces all occurrences of first string with second string.
ESC-% Replace the first string with the second string, but query for each occurrence (n goes to next, y replaces).

Miscellaneous Commands

ESC-x spell buffer Check spelling of the current buffer.
ESC-x spell word Check spelling of the word at the point.
C-q Allow the insertion of a control sequence.
ESC-c Capitalizes character at the point and makes rest of word lowercase.
ESC-l
ESC-u Changes word to uppercase from the point to the end of the word.

Help and Useful Commands

C-h Start help. C-h three times for help menu.
C-g Stops current command.
C-x u Undo the last keystroke.
ESC-# Completes a command # times (where # is a number).