Professional Documents
Culture Documents
I N D I A N A U N I V E R S I T Y
C – Press and hold down the CONTROL key while pressing the next letter. M – Press and release the ESC key (or press and hold the Meta key, if your keyboard has one).
Starting Emacs Incremental Search Query Replace Case Change
To enter GNU Emacs 19, just type its name: emacs search forward (can be repeated) C-s interactively replace a text string M-% uppercase word M-u
To read in a file to edit, see Files, below. search backward (can be repeated) C-r using regular expressions lowercase word M-l
regular expression search M-C-s M-x query-replace-regexp capitalize word M-c
reverse regular expression search M-C-r uppercase region C-x C-u
Leaving Emacs Valid responses in query-replace mode are: lowercase region C-x C-l
suspend Emacs (or iconify it under X) C-z These commands are available during searching: replace this one, go on to next SPC or y capitalize region M-x capitalize-region
exit this Emacs session C-x C-c select previous search string M-p replace this one, don’t move ,
select next later search string M-n skip to next without replacing DEL or n
undo effect of last character DEL replace all remaining matches ! The Minibuffer
General exit incremental search
abort current search
RET
C-g
back up to the previous match
exit query-replace
^
ESC or RET
The following keys are defined in the minibuffer:
press and hold the CTRL key C- complete as much as possible TAB
enter recursive edit (M-C-c to exit) C-r complete up to one word SPC
press and release ESC (or press and hold META) M-
give an argument to command C-u command complete and execute RET
give a numerical argument # to command
Motion show possible completions ?
C-u # command entity to move over backward forward Multiple Windows fetch previous minibuffer input M-p
character C-b C-f delete all other windows C-x 1 fetch next later minibuffer input M-n
word M-b M-f delete this window C-x 0 regexp search backward through history M-r
Files line
go to line beginning (or end)
C-p
C-a
C-n
C-e
split window in two vertically
split window in two horizontally
C-x 2
C-x 3
regexp search forward through history
abort command
M-s
C-g
read a file into Emacs C-x C-f
sentence M-a M-e scroll other window M-C-v
save a file back to disk C-x C-s
paragraph M-{ M-} switch cursor to another window C-x o Type C-x ESC ESC to edit and repeat the last command
save all files C-x s
page C-x [ C-x ] shrink window shorter M-x shrink-window that used the minibuffer. The following keys are then
insert contents of another file into this buffer C-x i
sexp M-C-b M-C-f grow window taller C-x ^ defined:
replace this file with the file you really want C-x C-v
function M-C-a M-C-e shrink window narrower C-x { previous minibuffer command M-p
write buffer to a specified file C-x C-w
go to buffer beginning (or end) M-< M-> grow window wider C-x } next minibuffer command M-n
scroll to next screen/prev screen M-v C-v select buffer in other window C-x 4 b
scroll right/left C-x > C-x < display buffer in other window C-x 4 C-o
Getting Help scroll current line to center of screen C-l find file in other window C-x 4 f Buffers
begin tutorial for first-time users C-h t find file read-only in other window C-x 4 r select another buffer C-x b
enter Help system C-h run Dired in other window C-x 4 d list all buffers C-x C-b
remove Help window C-x 1 Killing and Deleting find tag in other window C-x 4 . kill a buffer C-x k
scroll Help window ESC C-v
entity to kill backward forward
apropos: show commands matching a string C-h a
character (delete, not kill) DEL C-d
show the function a key runs C-h c
word M-DEL M-d Formatting Transposing
describe a function C-h f
line (to end of) M-0 C-k C-k indent current line (mode-dependent) TAB transpose characters C-t
get mode-specific information C-h m
sentence C-x DEL M-k indent region (mode-dependent) M-C-\ transpose words M-t
sexp M--M-C-k M-C-k indent sexp (mode-dependent) M-C-q transpose lines C-x C-t
kill region C-w indent region rigidly arg columns C-x TAB
Error Recovery copy region to kill ring M-w insert newline after point C-o
transpose sexps M-C-t
abort partially typed or executing command C-g kill through next occurrence of char M-z char move rest of line vertically down M-C-o
recover a file lost by a system crash
M-x recover-file
yank back last thing killed
replace last yank with previous kill
C-y
M-y
delete blank lines around point
join line with previous (with arg, next)
C-x C-o
M-^
Spelling Check
undo an unwanted change C-x u or C-_ check spelling of current word M-$
delete all white space around point M-\
restore a buffer to its original contents check spelling of all words in region
put exactly one space at point M-SPC
M-x ispell-region
M-x revert-buffer Marking fill paragraph M-q
check spelling of entire buffer M-x ispell-buffer
redraw garbaged screen C-l set fill column C-x f
set mark here C-SPC or C-2 or C-@
exchange point and mark C-x C-x set prefix each line starts with C-x .
set mark arg words away
mark paragraph
M-@
M-h
Shells
mark page C-x C-p execute a shell command M-!
mark sexp M-C-SPC or M-C-@ run a shell command on the region M-|
mark function M-C-h filter region through a shell command C-u M-|
mark entire buffer C-x h start a shell in window *shell* M-x shell
C – Press and hold down the CONTROL key while pressing the next letter. M – Press and release the ESC key (or press and hold the Meta key, if your keyboard has one).