希望成为一个有思想,有信仰的程序设计师。
分类: C/C++
2012-11-23 22:16:20
1.insert:
i :inserts a character before the character under the cursor
a :insert text after the cursor(append)
o :open up a new line below the cursor
2.Deleting
dd : deletes the line on which the cursor is positioned
d[n]w :deletes n words begin with the cursor once
[n]dw :deletes only one word every time but repeat operation n times.
3.Movement Commands
[n]$ :Moves to the end of the N-th line,begin with current line.
[n]^ :Moves to the first nonblank character of the N-th line,begin with current line.
[n]G :Puts you on line n from current cursor.
h : move left
j : move down
k : move up
l : move right
g0 :go the begin of the current line
g$ :go the end of the current line
gm :go the middle of the current line
notice:the " [n] " just express an Integer ,such as "1"
4.Undo and Redo
u : undo the changes
5.Position(where am i)
:set number : display the line number
6.Copy and paste
yy : copy current line
p : put a register after the cursor position .In other word ,paste the buffer next line of the cursor.
notice : almost all the command listed can inserted an Integer n before ,and it means repeat the command n times.
Reference
[1] vimguide-0.7-a4-1200.pdf
[2] vimbook-OPL.pdf