Information Technology Services - Computing, Networking and Storage

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. 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 hMark entire buffer as the region, with mark at end and place point at start.

Editing Commands

C-kDelete the current line to the right.
C-wDelete the current region.
ESC-wCopy a region.
C-yYank (paste) the last region or set of lines deleted at the current point.
C-dDelete next character.
Esc-dKill next word (can be yanked back).
Esc-DELKill previous word.

File Commands

C-x C-sSave file but do not quit Emacs.
C-x C-cQuit Emacs, giving option to save if there are unsaved changes.
C-x C-wWrite file, option to change the filename.
C-x iInsert a file at the current point.
C-x C-fEdit another file.

Buffer and Screen Commands

C-lRefresh the screen.
C-vMove down a screen.
ESC-vMove up a screen.
C-x 2Split the screen vertically into two windows.
C-x 3Split the screen horizontally into two windows.
C-x oMove to the other window.
C-x 1Fill screen with current window.
C-x 0Delete currently selected window.
C-x C-bList all of the current buffers.
C-x bSwitch to buffer (Emacs prompts for the buffer's name).
ESC-x shellStart a UNIX shell in the current buffer.

Search and Replace

C-sSearch forward; pushing C-s again Searches for the next occurrence.
C-rSearch backward; pushing C-r again searches for the next occurrence.
C-gCancel the current search or go back to previously found search item if search was done again.
ESC-x replace stringReplaces 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 bufferCheck spelling of the current buffer.
ESC-x spell wordCheck spelling of the word at the point.
C-qAllow the insertion of a control sequence.
ESC-cCapitalizes character at the point and makes rest of word lowercase.
ESC-l
ESC-uChanges word to uppercase from the point to the end of the word.

Help and Useful Commands

C-hStart help. C-h three times for help menu.
C-gStops current command.
C-x uUndo the last keystroke.
ESC-#Completes a command # times (where # is a number).

Last Updated: Friday, June 02, 2006 at 12:07PM PDT