在文章《
成就vim高手(一)--vim命令》中,我列出了vim编辑器中常用的命令。但是在实际的工作中,只用到这些vim命令是无法达到高效工作的。我们项目组老大说:“vim的确是好东西,可有一个不好的就是敲键盘会敲到手疼。”。我也比较认同这一点,有没有办法让我们少敲键盘又达到高效的工作呢?当然有,合理使用丰富的vim插件会让你事半功倍。下面我就简单介绍几个常用的vim插件,以求抛砖引玉。
以下所有的插件可以放在~/.vim/plugin/目录中,windows则放在vim安装目录中的.\vimfiles\plugins\目录中
1.a.vim
网址:http://www.vim.org/scripts/script.php?script_id=31
作用:在*.h和*.cc或*.cpp文件之间相互切换
用法::AV(在新的垂直窗口打开对应的文件)
:AS(在新的水平窗口打开对应的文件)
:A switches to the header file corresponding to the current file being edited (or vise versa)
:AS splits and switches
:AV vertical splits and switches
:AT new tab and switches
:AN cycles through matches
:IH switches to file under cursor
:IHS splits and switches
:IHV vertical splits and switches
:IHT new tab and switches
:IHN cycles through matches
2.tetris.vim (俄罗斯方块游戏)
网址:http://www.vim.org/scripts/script.php?script_id=172
作用:工作之余休闲娱乐,也可作为vim初学者练习h/j/k/l键的使用
用法:\te
h: left
l: right
j: down
i,k: rotate
<Space>: drop
<Esc> or q: quit
3. matrix.vim (黑客帝国中那种字母向下掉的效果)
网址:http://www.vim.org/scripts/script.php?script_id=1189
作用:纯属娱乐,可在MM面前炫耀
用法::Matrix
4. taglist.vim (列出类名、函数名、宏)
网址: http://www.vim.org/scripts/script.php?script_id=273
用法::Tlist(:TlistToggle)
5. calendar.vim(日历)
网址: http://www.vim.org/scripts/script.php?script_id=52
用法:\cal 在vim左侧打开日历
\caL 在vim下方打开日历
参考资料:
[1]. Vim实用技术,第1部分:实用技巧 http://www.ibm.com/developerworks/cn/linux/l-tip-vim1/index.html
[2]. Vim实用技术,第2部分:常用插件 http://www.ibm.com/developerworks/cn/linux/l-tip-vim2/index.html
以下所有的插件可以放在~/.vim/plugin/目录中,windows则放在vim安装目录中的.\vimfiles\plugins\目录中
1.a.vim
网址:http://www.vim.org/scripts/script.php?script_id=31
作用:在*.h和*.cc或*.cpp文件之间相互切换
用法::AV(在新的垂直窗口打开对应的文件)
:AS(在新的水平窗口打开对应的文件)
:A switches to the header file corresponding to the current file being edited (or vise versa)
:AS splits and switches
:AV vertical splits and switches
:AT new tab and switches
:AN cycles through matches
:IH switches to file under cursor
:IHS splits and switches
:IHV vertical splits and switches
:IHT new tab and switches
:IHN cycles through matches
2.tetris.vim (俄罗斯方块游戏)
网址:http://www.vim.org/scripts/script.php?script_id=172
作用:工作之余休闲娱乐,也可作为vim初学者练习h/j/k/l键的使用
用法:\te
h: left
l: right
j: down
i,k: rotate
<Space>: drop
<Esc> or q: quit

3. matrix.vim (黑客帝国中那种字母向下掉的效果)
网址:http://www.vim.org/scripts/script.php?script_id=1189
作用:纯属娱乐,可在MM面前炫耀
用法::Matrix

4. taglist.vim (列出类名、函数名、宏)
网址: http://www.vim.org/scripts/script.php?script_id=273
用法::Tlist(:TlistToggle)
5. calendar.vim(日历)
网址: http://www.vim.org/scripts/script.php?script_id=52
用法:\cal 在vim左侧打开日历
\caL 在vim下方打开日历
参考资料:
[1]. Vim实用技术,第1部分:实用技巧 http://www.ibm.com/developerworks/cn/linux/l-tip-vim1/index.html
[2]. Vim实用技术,第2部分:常用插件 http://www.ibm.com/developerworks/cn/linux/l-tip-vim2/index.html