VI Editor

Goto:

: => line mode, operates on current line unless specific line numbers are specified

^ or 0 ==> beginning of line
$ ==> end of line

:0==>beginning of file
G ==> end of file

nG ==> go to line n
:n ==> go to line n

Return ==> first non-blank char

H ==> top line on screen
L ==> last line on screen
M ==> middle of screen
Ctrl+L ==> Redraw screen??
b              beginning of previous word              
w              beginning of next word                  
e              end of current/next word                
0 (zero) or ^  beginning of line                       
$              end of line                             
(              beginning of current/previous sentence  
)              beginning of next sentence              
{              beginning of current/previous paragraph 
}              end of current paragraph                
H              top line on screen                      
M              middle line on screen                   
L              bottom line on screen

Search and Replace

The search command is /.  
/hello => search for "hello"
n repeats the search in the same direction
N repeats the search in the opposite direction

:s/search_string/replacement_string => global search and replace

:s/search_string/replacement_string/g => global search and replace


:s/search_string/replacement_string/gc => global search and replace with confirm

Yank (copy) and Put (paste)

yw yank rest of word
y$ yank rest of line
yy yank entire line
Y yank entire line

p put yanked/deleted text before cursor
P put yanked/deleted text after cursor