Table of Contents


Movement Commands
Word/LineScreen
hgo one space leftctrl-dgo down half a screen
lgo one space rightctrl-ugo up half a screen
jgo one line downctrl-fgo forward a screen
kgo one line upctrl-bgo back a screen
wgo to next wordHgo to top of screen
W   go to next spaceMgo to middle of screen
bgo to start of wordLgo to bottom of screen
Bgo to previous spaceGgo to end of text
ego to end of wordxGgo to line x
^beginning of linemxmark this line by x
$end of line`xgo to line marked by x

Return to Top


Text Modification Commands
DeleteChange
dddelete the current lineccchange the current line
xdddelete x linesxccchange x lines
dwdelete to end of wordcwchange to end of word
dWdelete to the next spacecWchange to next space
dbdelete to beginning of wordcbchange to beginning of word
dBdelete to the previous spacecBchange to previous space
Ddelete to end of lineCchange to end of line
xdelete charactersSubstitute text for character
Xdelete character to leftSSubstitute for entire line

Return to Top


Search Commands
/patternsearch forward through the text for pattern
?patternsearch backward through the text for pattern
nrepeat the most recent search

Return to Top


Insert CommandsMiscellaneous Commands
iinsert modectrl-gshow status line
aappend modectrl-lredraw screen
Iinsert at beginning of lineJjoin two lines together
Aappend at end of line.repeat the last command
rreplace a single characteruundo the last command
R   overstrike modeUrestore line to original
oopen a line below the cursor~change case of character
Oopen a line above the cursorxptranspose two characters

Return to Top


Yank and Put Commands
pput the last deleted line(s) after the current line
Pput the last deleted line(s) before the current line
yyyank the current line into the buffer
"xnyyyank n lines into x buffer
"xpput the contents of x buffer after current line

Return to Top


Saving, Quitting and Colon Commands
:! cmdexecute cmd
:e fileedit file
:nnext file; when editting multiple files
:qquit the editor (allowed only if no changes)
:q!quit the editor no matter what
:r fileread the contents of file into editor
:r! cmdread output of cmd into text
:wwrite the contents of the editor to the original file
:w filewrite the contents of the editor to file
:wqwrite out the file and quit the editor
ZZwrite out the file and quit the editor

Return to Top