i
go to insert mode (at cursor position)
I
start editing at the beginning of the line
o
go to insert mode on a new line bellow
O
go to insert mode on a new line above
A
insert at the end of the line
ESC
go to command mode
:wq
write and quite
:q
quite
:q!
quite discarding changes
:12
go to line 12
:$
go to the end of file
$
go to the end of line
^
go to the beginning of the line
0
same as above
yy
copy current line
3 yy
copy three lines
dd
cut current line
p
paste
J
join lines
/robert
search for the word "robert"
n
next occurrence
?robert
search for "robert" in reverse order
u
undo
.
repeat last modification operation
cw
change word
x
delete backwards
w
skip to next word
5w
skip five words
b
skip to the previous word
)
skip to next sentence
(
skip to previous sentence
dw
delete word at the right
db
delete word at left
das
delete current sentence
:1,$s/robert/Robert/
from the begining of the file (1) to the end of file ($) search and replace (s) robert with Robert once per line
:1,$s/robert/Robert/g
similar with the oneup but global (g) replaces all occurences not one per line
:1,$s/robert/Robert/i
similar with the first one but makes search case insensitive
:3,5d
delete from line 3 to line 5
:1,$g/robert/d
delete all occurences of "robert" from beginning to the end of file
:1,.g/robert/d
delete all occurences of "robert" from beginning to the current position
:se nu
turn on line numbers
:se nonu
turn off line numbers
Wednesday, August 26, 2009
VIM tutorial
Basic commads
More complex stuf
Set commands
Posted by Robert at 8/26/2009 12:26:00 PM
Subscribe to:
Post Comments (Atom)
0 Comments:
Post a Comment