Quick Guide
to Popular UNIX Editors

This table contains some of the most common activities within the two most popular UNIX editors.  In all that follows, you hold down the Ctrl key (C) when you keystroke another key.  This is represented by the tie (-) between the keys.  Thus C-x means hold down Ctrl and strike x.  On the other hand, the Esc key (M) should not be held down while striking another key.  Thus M x means strike and release Esc, then strike and release x.  

Key Strokes:
C -> Ctrl       M -> Esc       E ->Enter 

Editing Acclivity  GNU emacs  vi 
edit a file  emacs file E vi file E 
exit without saving  C-x C-c  :q! E 
save without exiting  C-x s  :w E 
continue editing different file  C-x C-f file E   
insert contents of file  C-x i file E  :r file E 
write contents to new-file  C-x C-w new-file E  :w new-file E 
search forward for string  C-s string M  /string E 
search backward for string  C-r string M  ?string E 
replace this with that  M x replace-string E  :1,$s/this/that/g E 
            this E that E   
go to beginning of file  M 1G 
go to end of file  M
go to line 7  M x go to-lineE 7 E  7G 
page forward  C-v  C-f 
page backward  M C-b 
line forward  C-n  C-n or j or ¯ 
line backward  C-p  C-p or k or ­ 
character forward  C-f  space-bar or l or ® 
character backward  C-b  C-h or h or ¬ 
first column of a line  C-a 
last column of a line  C-e 
enter text at cursor text  i text M 
enter text at end of line  C-e text  A text M 
over write with text    R text M 
delete line remainder  C-k 
delete line and collapse C-a C-k C-k  dd 
delete character  C-d 
yank a line to unnamed buffer  C-a C-k C-k  yy 
paste buffer after cursor  C-y 
refresh screen display  C-l  C-l 
undo last command  C-x u 
split lines at cursor  E  i E M 
join current line with next line  C-e C-d 
activate menu system  M  `   
invoke on-line help  C-h   
start tutorial  C-h t   
compilation with Make file  M x compile E E   
parse GNU compiler messages  C-x  `   
change windows  C-x o   
expand current windows  C-x 1   

File translated from TEX by TTH, version 0.9.

Send corrections and comments to somplski@oakton.edu