The Emacs Command Set

This page will list most of the default command set that comes with GNU-Emacs.

Line breaks are represented as single Newline characters, regardless of the representation used by the operating system.

Notation

The Escape key (usually labelled "Esc") which sends the escape character is used as a prefix to make up for the missing Meta shift key. By convention, those keyboards that have an extra shift key (perhaps labelled Meta or Alt) can specify meta commands by setting bit 2^7 in characters sent from the keyboard.

Emacs commands are, by convention, always upper/lower case-independent. Thus, ^X B and ^X b both refer to the same command. The only exception is the "self-insert" command, where B inserts a "B" and b inserts a "b". Only the uppercase versions will be listed.

Default GNU-Emacs Command List

^@
Place the mark at the point.
^A
Move to the beginning of the current line.
^B
Move backward one character.
^C
Prefix for mode-specific commands.
^D
Delete the following character.
^E
Move to the end of the current line.
^F
Move forward one character.
^G
Abort execution and return to the edit loop.
^H
Help
^I
Tab to indentation in a language-specific manner.
^J
Insert a line break and indent in a language-specific manner.
^K
Delete the text to the end of the current line; if at the end of the line, delete the line break. With an argument, delete that many complete lines.
^L
Rebuild the display from scratch, centering the point.
^M
Insert a line break, leaving the point after the break.
^N
Move down one line, staying in as nearly the same column as possible. If at the end of the buffer, grow the buffer.
^O
Insert a line break, leaving the point before the break.
^P
Move up one line, staying in as nearly the same column as possible.
^Q
Quote: Insert the following character as typed.
^R
Reverse search (see ^S).
^S
Search incrementally for a string after the point:
^R
Search for the previous occurrence.
^S
Search for the next (2nd, 3rd...) occurrence.
^?
"Untypes" the last character (including ^R, ^S, etc.)
^G
Abort search: return to starting place.
^[
Complete the search.
^Q
Quote a search command.
ctrl-XX
Complete the search and execute the XX command.
other
Add the character to the search string.
^T
Interchange the characters on each side of the point, leaving the point after the second one.
^U
Universal argument. There are two forms:
^U ^U .... <cmd>
does <cmd> 4, 16, 64, 256, ... times depending upon the number of ^Us (each ^U is a multiplier by 4).
^U <integer> <cmd>
does <cmd> <integer> times. (e.g., ^U 3 5 ^F means to ^F 35 times).
^V
Move the bottom of the current screen to the top of the screen: i.e., move down one screen.
^W
Delete the text between the point and the mark ("cut").
^X
Prefix for the ^X commands listed below.
^Y
Copy the top item from the kill ring to the point; place the mark at the beginning of the block and the point at the end ("paste").
^Z
Suspend the program's execution and return to whatever invoked the editor.
^[
Prefix for the Meta commands listed below.
^\
Undefined.
^]
Aborts a recursive edit.
^^
Undefined.
^_
Undo.
 
 
 
 
SP ... ~
Insert themselves.
 
 
 
 
^?
Delete the preceding character.
 
 
 
 
BS
Same as ^H, also BACK SPACE.
TAB
Same as ^I.
LF
Same as ^J, also LINE FEED.
CR
Same as ^M, also CARRIAGE RETURN or RETURN.
ESC
Same as ^[, also ESCAPE.
DEL
Same as ^?, also DELETE or RUBOUT (obsolete).

Help Commands:

^H ^C
Describe the copying policy.
^H ^D
Describe the distribution policy.
^H ^H
Help on help.
^H ^N
View Emacs news.
^H ^W
Describe the (lack of) warranty.
^H ?
Help on help.
^H A
Apropos (which commands deal with ...?).
^H B
Describe the current key bindings.
^H C
Briefly describe a key.
^H D
Describe a function.
^H F
Describe a function.
^H I
Invoke the "info" subsystem.
^H K
Describe a key.
^H L
Describe problems with the (current) version ("lossage").
^H M
Describe a mode.
^H N
View Emacs news.
^H S
Describe syntax.
^H T
Tutorial.
^H V
Describe a variable.
^H W
Where is ...?

Control-X (^X) Commands:

^X ^@
Flush mouse queue.
^X ^A
Add mode abbreviation.
^X ^B
Display a list of all buffers and associated information.
^X ^C
Exit editor.
^X ^D
Display the current directory.
^X ^E
Evaluate the last S-exp.
^X ^F
Ask for the name of a file and read it into a new buffer whose name is derived from the file name.
^X ^G
Cancel ^X prefix.
^X ^H
Remove mode abbreviation.
^X ^I
Indent rigidly
^X ^L
Convert the region to lower case.
^X ^N
Set the goal column.
^X ^O
Delete the blank lines around the point.
^X ^P
Place the point and the mark around the current page.
^X ^Q
Toggle the "read only" marker.
^X ^R
As ^X ^F, but mark the file "read only."
^X ^S
Save the current buffer if it has been modified.
^X ^T
Transpose lines.
^X ^U
Convert the region to upper case.
^X ^V
Find alternate file.
^X ^W
Ask for the name of a file and write the buffer to that file.
^X ^X
Exchange the point and mark.
^X ^[
Repeat a complex command.
^X $
Set selective display.
^X '
Expand an abbreviation.
^X (
Start collecting a keyboard macro.
^X )
End collecting a keyboard macro.
^X +
Add global abbreviation.
^X -
Remove global abbreviation.
^X .
Set the fill prefix.
^X /
Point to register.
^X 0
Delete window.
^X 1
Delete other windows.
^X 2
Split window vertically (one above the other).
^X 3
Split window vertically (one above the other), but stay in the first.
^X 4
Prefix for the Control-X 4 commands listed below.
^X 5
Split window horizontally (one beside the other).
^X ;
Set the comment column.
^X <
Scroll the window left.
^X =
Display the current cursor position.
^X >
Scroll the window right.
^X A
Append the region to a buffer.
^X B
Switch to a buffer.
^X D
Edit directory ("DIRED").
^X E
Invoke the last keyboard macro.
^X F
Set the fill column to the horizontal position.
^X G
Insert a register.
^X H
Place the point and the mark around the entire buffer.
^X I
Insert a file.
^X J
Register to point.
^X K
Kill a buffer.
^X L
Count the number of lines in the page.
^X M
Send electronic mail.
^X N
Narrow the editing bounds to the region.
^X O
Switch to the other window.
^X P
Narrow the editing bounds to the page.
^X Q
Keyboard macro query.
^X R
Copy a rectangle to a register.
^X S
Save some buffers.
^X U
Advertised undo.
^X W
Widen the editing bounds.
^X X
Copy to a register.
^X [
Move backward one page.
^X ]
Move forward one page.
^X ^
Grow the current window.
^X `
Move to the location implied by the next error message.
^X {
Shrink a window horizontally.
^X }
Grow a window horizontally.
^X ^?
Delete to the beginning of the current sentence.

Control-X 4 Commands:

^X 4 ^F
Find file other window.
^X 4 .
Find tag other window.
^X 4 A
Add change log entry other window.
^X 4 B
Switch buffer other window.
^X 4 D
DIRED other window.
^X 4 F
Find file other window.
^X 4 M
Mail other window.

Meta (^[) Commands:

^[ ^@
Place the point and the mark around the S-exp.
^[ ^A
Move to the beginning of the current defun.
^[ ^B
Move backward one S-exp.
^[ ^C
Exit recursive edit.
^[ ^D
Move down one level of list structure.
^[ ^E
Move to the end of the current defun.
^[ ^F
Move forward one S-exp.
^[ ^G
Format ("grind") the current S-exp.
^[ ^H
Place the point and the mark around the S-exp.
^[ ^I
Complete a Lisp symbol.
^[ ^J
Indent a new comment line.
^[ ^K
Delete the following S-exp.
^[ ^N
Move forward one list.
^[ ^O
Split line: move the rest of this line vertically down.
^[ ^P
Move backward one list.
^[ ^Q
Indent an S-exp.
^[ ^S
Incremental search forward using regular expressions.
^[ ^T
Transpose the adjoining S-exp.
^[ ^V
Scroll the other window.
^[ ^W
Append the next delete to the top item on the kill ring.
^[ ^X
Evaluate a defun.
^[ ^[
Evaluate an expression.
^[ ^\
Indent the region.
^[ SP
Insert exactly one space.
^[ !
Ask for and execute a shell command.
^[ $
Invoke the spelling checker on a word.
^[ %
Query replace: ask for an old string and a new string. At each occurrence of the old string, display it and ask for a command:
^L
Redisplay the screen.
^R
Invoke the editor recursively.
^W
Delete the old string and invoke the editor recursively.
^[
Exit.
SP
Replace the old with the new and continue.
,
Replace and wait for confirmation.
.
Replace and exit.
!
Replace the rest without asking.
^
Return to previous old string (jump to mark).
^?
Don't replace but continue.
^[ '
Set abbreviation prefix mark.
^[ (
Insert paired parentheses.
^[ )
Move past the closing parenthesis.
^[ ,
Tags loop continue.
^[ -
Make the argument negative.
^[ .
Find a tag.
^[ /
Abbreviation expand.
^[ 0 .. 9
Use digits as argument (similar to ^U).
^[ ;
Indent for comment.
^[ <
Move to the beginning of the current buffer.
^[ =
Count the lines within the region.
^[ >
Move to the end of the current buffer.
^[ @
Place the point and mark around the current word.
^[ A
Move to the beginning of the current sentence.
^[ B
Move backward one word.
^[ C
Capitalize the following word.
^[ D
Delete the following word.
^[ E
Move to the end of the current sentence.
^[ F
Move forward one word.
^[ G
Fill text in the region.
^[ H
Place the point and the mark around the current paragraph.
^[ I
Tab to tab stop.
^[ J
Indent new comment line.
^[ K
Delete the remainder of the current sentence.
^[ L
Convert the following word to lower case.
^[ M
Move back to indentation.
^[ Q
Fill the current paragraph. ^U ^[ Q means to justify the paragraph.
^[ R
Move to window line.
^[ T
Transpose the adjoining words.
^[ U
Convert the following word to upper case.
^[ V
Move the top of the current screen to the bottom of the screen: i.e., move up one screen.
^[ W
Copy the region to the kill buffer.
^[ X
Execute extended command.
^[ Y
After ^Y: Delete the just-yanked text and yank the previously killed text.
^[ Z
Zap to character.
^[ [
Move to the beginning of the current paragraph.
^[ \
Delete the spaces and tabs around the point.
^[ ]
Move to the end of the current paragraph.
^[ ^
Delete the indentation on the current line.
^[ |
Execute a shell command on the region ("pipe the region through a shell command").
^[ ~
Clear the buffer modified flag.
^[ ^?
Delete the previous word.

Copyright 1999 by Craig A. Finseth.