VI

vi filename Open the file filename for editing in VI


Once within VI, some example commands:
i Enter insert mode to start typing text
Esc Exit insert mode
:w Save the file
:w filename Save the file as filename
:wq Save the file and quit VI
:q! Quit VI without saving changes
:59 Go to line number 59
h,j,k,l Move the cursor left, up, down, right
yy Copy a whole line of text
p Paste a copied line of text
x Delete a character
u Undo
4dw Delete 4 words
4dd Delete 4 lines
/pattern Search for the next occurrence of pattern
n Search for the next occurrence of the previously searched pattern
?pattern Search backwards for pattern




Matt Disney 2005-09-14