VI Basic Commands: DW D DD
VI Basic Commands: DW D DD
VI Basic Commands: DW D DD
dw
D
dd
Repeating commands
.
Replacing strings
Can also be done manually, searching and replacing once, and then using
n (next occurrence) and . (repeat last edit).
n,ps/str1/str2/g between line numbers n and p, substitute all (g:
global) occurrences of str1 by str2.
1,$s/str1/str2/g in the whole file ($: last line), substitute all
occurrences of str1 by str2.
Misc
[Ctrl]l redraw the screen.
J
join the current line with the next one
u
undo the last action
Going further
vi has much more flexibility and many
more commands for power users!
It can make you extremely productive
in editing and creating text.
Learn more by taking the quick tutorial:
just type vimtutor.