Notes on playing with VIM

来源:互联网 发布:启用MIUI优化 编辑:程序博客网 时间:2024/05/14 16:04

"Mouse can never survive under the mighty VIM."


Three steps to learn how to use VIM:

i.   do never touch your mouse

ii.  memorize the key mapping in your mind

        iii. forget about the key mapping



Part I:  Basic Cursor Movement

-------------------------------------------------------------------------------------

k     up

hl    =>  left    right

j  down

-------------------------------------------------------------------------------------

w=>move the cursor to the first letter of the next word

e=>move the cursor to the last  letter of the next word

b=>move the cursor to the first letter of the previous word

-------------------------------------------------------------------------------------

^=>move the cursor to the first non-blank of the current line

0=>move the cursor to the first position of the current line

$=>move the cursor to the last  position of the current line

-------------------------------------------------------------------------------------

gg=>move the cursor to the beginning of the file

G=>move the cursor to the end of the file

-------------------------------------------------------------------------------------

f(x)=>find the first character of (x) after    the cursor

F(x)=>find the first character of (x) before the cursor

Notice: the score () is only a gesture used for explaining down below. No need to type in VIM.

-------------------------------------------------------------------------------------

Ctrl + e => roll down for one line

Ctrl + y => roll up      for one line

Ctrl + d => roll down for half a screen

Ctrl + u => roll up      for half a screen

Ctrl + f => roll down for a whole screen

Ctrl + b => roll up      for a whole screen

-------------------------------------------------------------------------------------


Part II:  File Editting

-------------------------------------------------------------------------------------

y(x)=>copy from the cursor to the position (x)




0 0
原创粉丝点击