VI
Command Line
vim name.spec -c 'wq'
Movement
By Character
k
^
h < > l
j
3 lines down 3j
By Line
nG Go to Line n
0 first position of line
$ last position of line
^ or _ first non whitespace char of line
+ first char of next line
- first char of previous line
misc
fm forward to CHAR m
Fm backward to CHAR m
w forward to next word
b to previous word
e to end of next word
) next sentence
( previous sentence
Editing
a Append after cursor
A or $a Append at end of line
i insert before Cursor
I or _i insert at beginning of line
o open line below cursor
O open line above cursor
n>m indent n lines (m is movement)
n<m unindent n lines (m is movement)
. repoeat last command
U undo chages pon current line
u undo last command
Copy & Paste
dm delete (m is movement)
dd delete line
D or $d delete to end of line
x delete char under cursor
X delete char before cursor
ym yank to buffer copY (m is movement)
yy yank current line
p paste from buffer after cursor
P pasete before cursor
Find & Replace
/w search forward to w
?w search backwards to w
n repeat search
N repeat backwards search
:s/old/new replace next occurance of old with new
:s/old/new/g replace all occurances of old with new