Professional Documents
Culture Documents
VI - Cheat - Sheet Onepager
VI - Cheat - Sheet Onepager
VI - Cheat - Sheet Onepager
Insert:
i insert in place of cursor
a append after cursor
A append end of line
o new line below cursor
O new line above cursor
Delete:
x del single char on cursor
X del backwards a char (backspace)
3x del 3 chars forward
dw del word
3dw del 3 words
dd del current line
3dd del 3 lines (inc. current)
dG del up to start of file
d1G del down to end of file
"x2dd del 2 lines to name "x"
:x,yd del from line x to y
cc rewrite whole line
C rewrite to end of the line
:r <file> inser file under current line
Move:
f forward a char
F backward a char
w next word
b start of word
e end of word
( back a sentence
) forward a sentence
% move to matching bracket
0 move to start of line
$ move to end of line
H move to start of screen
M move to middle of screen
L move to end of screen
G move to end of file
1G move to start of file
nG move to n.th line
:/pattern/d Find line cont. pattern & del
Ctrl+g show line number
Ctrl+f scroll forward a page
Ctrl+b scroll backward a page
Misc:
u undo last change
U undo changes to line
J join lines
nJ join next n lines
. repeat last command
Commands:
:q quit (if there were no changes)
:q! quit without changes
:w save
:wq save and wuit
:set ic = ignore case
:set noic = case sensitive
:set nu set line numbers
:set nonu unset line numbers