vi Quick List

Commands

^B Page Up
^F Page Down
 j Down one line
 k Up one line
 h Left one character
 l Right one character
 $ Jump to End of Line
 0 Jump to Begining of Line
 G Jump to end of document
 i Insert text at the cursor
 a Insert text after cursor
 / search forward

^R redraw screen
^T tag pop
^V input a literal character
 # number increment/decrement
 % move to match
 & repeat substitution
 . repeat the last command
 ? search backward
 A append to the line
 B move back bigword
 C change to end-of-line
 D delete to end-of-line
 E move to end of bigword
 L move to screen bottom
 M move to screen middle
 O insert above line
 P insert before cursor from buffer
 R replace characters
 S substitute for the line(s)
 U Restore the current line
 W move to next bigword
 X delete character before cursor
 Y copy line
ZZ save file and exit
 a append after cursor
 b move back word
 e move to end of word
 i insert before cursor
 o append after line
 r replace character
 s substitute character
 u undo last change
 w move to next word
 x delete character
 ~ reverse case

Show Line Numbers

:set nu

Search and Replace First Instance of search_string on the Current Line Only

:s/search_string/replacement_string/

Search and Replace All Instances of search_string on the Current Line Only

:s/search_string/replacement_string/g

On Lines 1 Through 20 Search and Replace /var/log with /var/log/www Globaly

:1,20s/\/var\/log/\/var\/log\/www/g

Search and Replace All Instances of search_string on All Lines

:%s/search_string/replacement_string/g