Here is a list of other useful commands for vi. For a comprehensive list of commands, see the "VI QUICK REFERENCE" card. :wq write and quit :e xxx edit file 'xxx' :sh run a subshell n repeat last search N repeat last search but in opposite direction % find matching brace or parenthesis ) forward to next sentence or to next s-expr (lisp option) ( backward sentence or back s-expr (lisp option) '' back to previous location mX mark this spot with letter 'X' 'X go back to spot marked with 'X' J join this line and next D delete to end of line (same as d$) X delete character before cursor > left shift operator < right shift operator ! filter thru command operator :[addr1,addr2]s/pattern/replacement/[option] general pattern-match replacement (see ed(1) and ex(1)) :r fn read file "fn" into buffer :[addr1,addr2]d delete everything between addr1 and addr2