vi help

By no means comprehensive, but enough to get you by.

Key commands

[ESC]Exit a mode or cancel a compound command
iEnter insert mode
rEnter replace mode
:Enter command line mode (see below for command line commands)
ddDelete a line
yyCopy a line
PPaste a previously copied/deleted line
JJoin current line with next line
uUndo last command
[CTRL] RRedo last command

on the vi command line

command lineaction
q!Really quit
xSave and quit
x!Really save and quit (for read-only files)
g/pattern1/s//pattern2/gGlobal replace pattern1 with pattern2
set nuTurn on line numbers
set nonuTurn off line numbers
set icSet searching to be case insensitive


/regular expDo a regular expression search
:set icSet searching to be case insensitive