Vi Notes


How do I save?
:ZZ
:wq filename

How do I quit without saving?
:Q!

hjkl
h - left
k - up
j - down
l - right

Delete
x - delete character
dd - delete line

r - replace

Other
a - apend
i - insert

Search and Replace

:s/old/new		replace old with new on current line
:%s/old/new/g 		replace old with new for whole document

Special sequences allowed are:

& everything which was matched by the search 
\[1-9] The contents of the 1st-9th \(\) pair 
\u The next character will be made uppercase 
\U The characters until \e or \E will be made uppercase 
\l The next character will be made lowercase 
\L The characters until \e or \E will be made lowercase 
\[eE] end the selection for making upper or lowercase