Emacs Cheat Sheets
Emacs Cheat Sheets
C-x 1 One window on current buffer C-x C-w Write file; prompts for new
C-x 2 Split window vertically name
C-x s Save modified buffers; asks
C-x 3 Split window horizontally
about each
C-x ^ Grow window vertically; prefix is number of
C-x b Select buffer; prompts for
lines
buffer name
Command-related Stuff C-x C-b List buffers; shows in other
ESC Get me out of where I am now window
ESC
ESC C-x k Kill buffer; prompts for buffer
C-u # Prefix numeric arg # (digits with optional "-" name
sign) to next cmd Searching/Replacing
C-g Stop a command in progress, or quit out of a C-s Incremental search forward;
partially entered command searches as you type
Getting help C-r Incremental search
C-h k Show command documentation; prompts for backward
keystrokes C-M-s Regexp search forward
C-h a "Command apropos"; prompts for regexp and (there are differences in
shows all matching commands Emacs regexp syntax wrt
Perl, etc.)
C-h c Show command name on message line;
prompts for keystrokes
C-M-r Regexp search backward
C-h f Describe function; prompts for command or
M-x String replace from here to
replace- end of buffer; prompts for
function name, shows documentation in other string
window RET
string and replacement
C-h i Info browser; gives access to online M-x String replace from here to
documentation for emacs and more query- end of buffer, querying for
replace
each occurrence
Miscellaneous RET
M-x grep Prompts for a grep
C-_ or C-Undo/redo (a series of these keeps RET command, shows hits in a
x u undoing; after doing something else, C-_ buffer
or C-x u will undo the undo's)
C-x ` Visit next grep hit
C-q Quoted insert; inserts the next character
typed, even if it is a control or meta
character
M-x shell- Flush ^M at end of line
strip-
ctrl-m RET
C-z Suspend/iconify emacs (type "%emacs" in
invoking shell to get it back)
C-x C-c Exit emacs (asks about unsaved buffers
and running programs)