Common vi and vim commands
Command mode ESC
dd delete
u undelete
y yank (copy to buffer)
p/P p before cursor/P after cursor
Ctl-g show current line number
shft-G end of file
n shft-G move to line n
/stuff/ search
n repeat in same direction
N repeat in opposite direction
/return repeat seach forward
?return repeat seach backward
"dyy Yank current line to buffer d
"a7yy Yank next 7 lines to buffer a
or
:1,7ya a Yank [ya] lines 1,7 to buffer a
:1,7ya b Yank [ya] lines 1,7 to buffer b
:5 pu b Put [pu] buffer b after line 5
"dP Put the content of buffer d before cursor
"ap Put the contents of buffer a after cursor
:1,4 w! file2 Write lines 1,4 to file2
:1,3
:set nu Display line numbers
:set nonum Turns off display
:e <filename> Edit a file in a new buffer
vim
:split
:split <filename>
:sp <filename>
:split new
ctl-w To move between windows
ctl-w+
ctl-w- To change size
ctl+wv Split windows vertically
ctl-wq Close window
:only To view only 1 window
vim dictionary - put the following command in ~/.vimrc
set dictionary+=/usr/share/dict/words
set thesaurus+=/usr/share/dict/words
Now, after you type a word <ctl-x><ctl-k><ctl-n> and to
go back in the listing <ctl-p>
butter<ctl-x><ctl-k><ctl-n>