linux vim commands

source:

content:

(1) general form of vi commands: (command)(number)(text object)

or equivalent form: (number)(command)(text object)

 

(2)

i:insert进入insert mode,光标位置不变

I:insert at the begining of the line

a:appending 进入insert mode,光标位置后移一位

A:appending at the end of the line

o:Open blank line below the cursor

O:Open blank line above the cursor

 

h:move left by one space

j:move down by one line

k:move up by one line

l:move right by one space

 

0(digit zero): move to the beginning of the line

$:move to the end of the line

w:move forward by one word

b:move backward by one word

 

c:change + (text object) 通过text object定位更改内容的范围

cc:replace the entire line

C: = c$

 

r:replace by one character without changing mode

R:replacing process will not end until triggering ESC

 

s:更改,以character为计数单位来计数,从当前光标开始

S:更改整行

 

~:change case and move cursor forward by one space

 

d:delete +(text object)来定位删除的范围

dd: delete entire line

D: = d$

 

x:delete the character after the cursor by counting the number of characters(x to d is as r to c)

X:delete the character before the cursor by counting the number of characters

 

u:undo the last command

U: restore the line to its pristine state

 

p:put the last deleted content after current cursor (just like cut and paste)

P:put the last deleted content before current cursor

 

y:yank  +(text object)copy the text and use command p to paste

Y:yy, yank the entire line

 

. :repeat last command

J:join the current line together with the line below

 

(3)总结

 

 

 

 



posted @ 2012-04-03 20:49  KevinFromJail  阅读(247)  评论(0)    收藏  举报