"vi" The Holy Editor ================================================================================ --Insertion-- --Cursor Movement-- i (i)nsert before cursor l or right arrow (move right) a (a)ppend after cursor h or left arrow (move left) I (I)nsert at end of line j or down arrow (move down) A (A)ppend at eoln k or up arrow (move up) O (O)pen new line above $ move to eoln o (o)pen new line below ^ move to start of line w move to next (wo)rd B move to previous word --Deletion-- --Change Text-- dw (d)elete (w)ord cw (c)hange (w)ord dd (d)elete line cc (c)hange line D (D)elete to eoln R (R)eplace until ESC x delete char at cursor r (r)eplace current char X delete char to left dc (d)elete up and including the character 'c' --Scrolling-- --Special Commands-- z move current line to >n indent n spaces center of screen U (U)ndo all changes CTRL-d scroll (d)own u (u)ndo last operation CTRL-u scroll (u)p /(str) forward search for (str) CTRL-f one screen (f)orward ?(str) backward search for (str) CTRL-b one screen (b)ack n (n)ext occurrence of (str) CTRL-l redraw screen . repeat last command Y (Y)ank line p (p)aste below -- : Commands -- P (P)aste above :w (file) (w)rite file ZZ write & quit (same as :wq) :q! abort (no save) ESC cancel command or :wq write & quit exit from current mode :r (file) read a file nG goto line n :sh shell escape % goto next set of () or {} :n goto line n ( goto start of current :! cmd exec cmd sentence :s "s" "r" search for "s" ) goto end of current replace with "r" sentence :set (option) *see below { goto start of current paragraph } goto end of current paragraph d/str/ find and delete str ** Note: many commands like D, Y, dd, x, etc. can be preceeded by a number to denote how many characters, lines, words, etc. are to be modified. The set command: I've found the `set` command very helpful. You should type :set all in vi to get a list of all the options. (I've found `set autoindent` to be especially nice when writing programs).