1. 使tab键由默认的8个空格键变为4个空格键
:set tabstop=4 ### try :set all for more info.
###增加到$HOME/.vimrc中即可.
2. 替换OLD为NEW操作.
First occurrence on current line : :s/OLD/NEW
Globally (all) on current line : :s/OLD/NEW/g
Between two lines #,#: :#,#s/OLD/NEW/g [fx: 2,10s/OLD/NEW/g]
Every occurrence in file: :%s/OLD/NEW/g
3. 一些非常重要的快捷键. [src: http://blog.chinaunix.net/u2/74747/showart.php?id=2420736]
:set number ###显示行号
:set nonumber ###不显示行号
:n1,n2d ###删除n1到n2行内容
:u ###撤销上一次操作
:nyy ###复制当前行在内的n行
:w filename ###另存为文件filename