Emacs Reference Card PDF
Emacs Reference Card PDF
Emacs Reference Card PDF
Starting Emacs
To enter GNU Emacs 20, just type its name: emacs
To read in a file to edit, see Files, below.
Leaving Emacs
suspend Emacs (or iconify it under X)
exit Emacs permanently
C-z
C-x C-c
Files
read a file into Emacs
save a file back to disk
save all files
insert contents of another file into this buffer
replace this file with the file you really want
write buffer to a specified file
version control checkin/checkout
C-x
C-x
C-x
C-x
C-x
C-x
C-x
C-f
C-s
s
i
C-v
C-w
C-q
Getting Help
The help system is simple. Type C-h (or F1) and follow the directions. If you are a first-time user, type C-h t for a tutorial.
remove help window
scroll help window
C-x 1
C-M-v
C-h
C-h
C-h
C-h
a
c
f
m
Motion
Multiple Windows
backward
C-b
M-b
C-p
C-a
M-a
M-{
C-x [
C-M-b
C-M-a
M-<
to next screen
to previous screen
left
right
current line to center of screen
forward
C-f
M-f
C-n
C-e
M-e
M-}
C-x ]
C-M-f
C-M-e
M->
C-v
M-v
C-x <
C-x >
C-u C-l
When two commands are shown, the second is for other frame.
delete all other windows
C-x 1
split window, above and below
C-x 2
C-x 5 2
delete this window
C-x 0
C-x 5 0
split window, side by side
C-x 3
scroll other window
C-M-v
switch cursor to another window
C-x o
C-x 5 o
select buffer in other window
C-x 4 b
C-x 5 b
display buffer in other window
C-x 4 C-o C-x 5 C-o
find file in other window
C-x 4 f
C-x 5 f
find file read-only in other window
C-x 4 r
C-x 5 r
run Dired in other window
C-x 4 d
C-x 5 d
find tag in other window
C-x 4 .
C-x 5 .
grow window taller
C-x ^
shrink window narrower
C-x {
grow window wider
C-x }
Formatting
backward
DEL
M-DEL
M-0 C-k
C-x DEL
M-- C-M-k
forward
C-d
M-d
C-k
M-k
C-M-k
kill region
copy region to kill ring
kill through next occurrence of char
C-w
M-w
M-z char
C-y
M-y
Marking
Error Recovery
C-@ or C-SPC
C-x C-x
Case Change
M-@
M-h
C-x C-p
C-M-@
C-M-h
C-x h
uppercase word
lowercase word
capitalize word
uppercase region
lowercase region
C-g
recover-file
C-x u or C-_
revert-buffer
C-l
Incremental Search
C-s
C-r
C-M-s
C-M-r
M-p
M-n
RET
DEL
C-g
M-u
M-l
M-c
C-x C-u
C-x C-l
The Minibuffer
Query Replace
search forward
search backward
regular expression search
reverse regular expression search
TAB
C-M-\
C-M-q
C-x TAB
C-o
C-M-o
C-x C-o
M-^
M-\
M-SPC
M-q
C-x f
C-x .
M-g
SPC
,
DEL
!
^
RET
C-r
C-x b
C-x C-b
C-x k
Transposing
transpose
transpose
transpose
transpose
characters
words
lines
sexps
C-t
M-t
C-x C-t
C-M-t
Spelling Check
check spelling of current word
check spelling of all words in region
check spelling of entire buffer
M-$
M-x ispell-region
M-x ispell-buffer
Tags
find a tag (a definition)
find next occurrence of tag
specify a new tags file
M-.
C-u M-.
M-x visit-tags-table
Regular Expressions
any single character except a newline
zero or more repeats
one or more repeats
zero or one repeat
quote regular expression special character c
alternative (or)
grouping
same text as nth group
at word break
not at word break
entity
line
word
buffer
class of characters
explicit set
word-syntax character
character with syntax c
match start
^
\<
\
match these
[ ... ]
\w
\sc
M-!
M-|
C-u M-|
M-x shell
. (dot)
*
+
?
\c
\|
\( . . . \)
\n
\b
\B
match end
$
\>
\
match others
[^ . . . ]
\W
\Sc
Info
C-x
C-x
C-x
C-x
C-x
C-x
r
r
r
r
r
r
r
k
y
o
c
t
Abbrevs
C-x r s
C-x r i
C-x r SPC
C-x r j
Keyboard Macros
start defining a keyboard macro
C-x (
end keyboard macro definition
C-x )
execute last-defined keyboard macro
C-x e
append to last keyboard macro
C-u C-x (
name last keyboard macro
M-x name-last-kbd-macro
insert Lisp definition in buffer
M-x insert-kbd-macro
C-x C-e
C-M-x
M-x eval-region
M-:
M-x load-library
Simple Customization
customize variables and faces
M-x customize
Writing Commands
SPC
DEL
. (dot)
Rectangles
Shells
Registers
next node
previous node
move up
select menu item by name
select nth menu item by number (19)
follow cross reference (return with l)
return to last node you saw
return to directory node
go to any node by name
n
p
u
m
n
f
l
d
g
Other:
C-x
C-x
C-x
C-x
C-x
M-/
a
a
a
a
a
g
l
i g
i l
e
h
q
M-s