Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3355851
  • 博文数量: 1450
  • 博客积分: 11163
  • 博客等级: 上将
  • 技术积分: 11101
  • 用 户 组: 普通用户
  • 注册时间: 2005-07-25 14:40
文章分类

全部博文(1450)

文章存档

2017年(5)

2014年(2)

2013年(3)

2012年(35)

2011年(39)

2010年(88)

2009年(395)

2008年(382)

2007年(241)

2006年(246)

2005年(14)

分类: LINUX

2008-03-12 14:34:56

以下是滇狐收集和整理的一些有用的 VIM 插件, 大部分插件都有自己详细的说明书, 因此这里就不详细介绍每个插件的安装和使用方法了。 通过这些插件, VIM 能够变成一个非常强大的平台, Happy VIMming! 如果想详细了解默认的插件插件安装路径, 请看。

1 程序设计

1.1 Tag List

下载地址:

官方描述: The “Tag List” plugin is a source code browser plugin for Vim and provides an overview of the structure of source code files and allows you to efficiently browse through source code files for different programming languages.

滇狐评价: 这是一个非常非常非常非常重要的插件, 有了它, 我们才能够在 VIM 中查看一个文件中包含的函数列表, 或是一个类包含的方法列表, 为编程人员提供了极大方便。 推荐大家一定要安装!

安装注意事项: 有的系统内置的 ctags 功能太弱, 推荐大家安装 , 这个东西功能比较强大, 居然连 HTML 里面内嵌的 Java Script 都能够支持, 实在是匪疑所思!

滇狐个人习惯: 滇狐习惯把方法列表放在屏幕的右侧, 于是在 .vimrc 中设置了

let Tlist_Use_Right_Window=1

另外, 滇狐习惯让当前不被编辑的文件的方法列表自动折叠起来, 这样可以节约一些屏幕空间, 于是在 .vimrc 中设置了

let Tlist_File_Fold_Auto_Close=1

1.2 A

下载地址:

官方描述:

A few of quick commands to swtich between source files and header files quickly.

: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

E.g. if you are editing foo.c and need to edit foo.h simply execute :A and you will be editting foo.h, to switch back to foo.c execute :A again.

滇狐评价: 第一眼看到这个东西时, 总觉得它功能太简单, 似乎没有什么用处。 用过之后, 才发现这项功能对于一个程序员来说是如何重要!

1.3 Win Manager

下载地址:

官方描述: winmanager is a plugin which implements a classical windows type IDE in Vim-6.0. Basically, you have the directory tree and the buffer list as 2 windows which stay on the left and the editing is done in a seperate area on the left. People have already made excellent File and Buffer explorers seperately and I thought that it might be a cool idea to combine them both. winmanager.vim combines the standard File Explorer which ships with Vim 6.0 and a Buffer Explorer written by Jeff Lanzarotta into one package.

滇狐评价: 非常好用的东西, 在屏幕上打开一个文件浏览器, 这样就可以方便地选择要编辑的文件了。

默认情况下, winmanager 依赖于 bufexplorer, 到下载。 如果你不喜欢 bufexplorer 插件的话 可以在你的 .vimrc 中添加这条命令禁用它:

let g:winManagerWindowLayout = "FileExplorer"

这样就不需要下载该插件了。

滇狐为 winfileexplorer.vim 加了一个补丁, 提供了使用系统默认打开方式打开选中文件的功能, 只要把光标放在想要打开的文件上, 然后按“S”就可以了 (注意是大写)。 这样以后就可以直接在 gvim 里打开 xmms, 不用再切换出来找 konqueror 了。

1.4 gdbvim

下载地址:

官方描述: You have one window with (g)vim open, other window with gdb running. When you reach source line in your code, it appears in the vim window. In the opposite direction, you can send commands from vim to gdb (e.g., set breakpoints on given line).

滇狐评价: 该插件意义很重大, 为我们在 VIM 中调试程序提供了可能。 虽然功能还非常少, 但已经足以解决平常的大部分需求了。 原始版本问题比较多, 例如只能添加断点, 不能删除断点, 滇狐为该插件添加了删除已加断点的功能。 另外快捷键的设置也比较不快捷, 滇狐又顺便把相应的快捷键修改了一下, 现在用起来已经比较顺畅了, 放出来给大家参观一下, 以便继续改进。 目前只在 Linux 下调试通过, 其它平台未经测试, 感兴趣的朋友可以在其它平台下测试, 并汇报测试结果。

需要继续增加的功能: 下一步滇狐准备再给这个插件加上保存所有断点的功能, 这样下次调试的时候就不用重新设置断点了。 另外, 目前查看变量的值时, 只能把结果打印到 console 窗口中, 滇狐希望在下一个版本中能够把查看结果抓取到 VIM 中显示。 VIM 网站上给出了把所有结果抓取到 VIM 中的实现, 但那不是滇狐希望的结果。 滇狐最希望得到的结果是使用 tooltip 显示变量结果, 另外能够再提供一个 watch 窗口, 时刻监视变量的值, 以后慢慢实现吧。

安装注意事项: gdbvim 脚本是使用 Perl 语言编写的, 因此需要安装 Perl。 为了方便你的使用, 建议在 $PATH 路径下添加一个指向 plugin/gdbvim 脚本的符号链接, 或者直接将该文件复制到 $PATH 路径下, 滇狐推荐前者。 还有, 最好在你的 .vimrc 中 set noshowcmd, 否则大量的“请按 ENTER 继续”会把你活活烦死。 另外, 滇狐 patch 过的脚本依赖 , 如果你使用滇狐版的话, 需要再安装这个插件。

使用方法: 编译你的程序时加上 -g 参数生成调试信息, 然后使用“gdbvim <你的程序名>”启动 gdbvim, gdbvim 会自动启动一个 gvim。 将 gvim 最大化, 然后就可以使用 Gdb 菜单或快捷键添加断点、 单步调试程序、 查看变量值了。

1.5 jad

下载地址: 无。 自己将代码复制粘贴回去, 保存为 $HOME/.vim/plugins/jad.vim:

augr class
au!
au bufreadpost,filereadpost *.class %!jad -noctor -ff -i -p %
au bufreadpost,filereadpost *.class set readonly
au bufreadpost,filereadpost *.class set ft=java
au bufreadpost,filereadpost *.class normal gg=G
au bufreadpost,filereadpost *.class set nomodified
au bufreadpost,filereadpost *.class set nomodifiable
augr END

官方描述: (无)

滇狐评价: 挺好玩的插件, 不过似乎也只是好玩而已。 安装了之后可以直接双击打开 .class 文件, VIM 会自动调用 jad 把文件反编译了。

安装注意事项:需要先安装一份

1.6 cscope_maps

下载地址:

官方描述: Cscope is a very handy tool, but it’s even better when you don’t ever have to leave the comfort of your favorite editor (i.e. Vim) to use it. Fortunately, Cscope support has been built into Vim.

滇狐评价: 滇狐目前 cscope 用得不如 ctags 多, 许多功能都不大熟。 不过既然大家都说好, 那还是装着玩玩吧。

安装注意事项: 需要安装

1.7 project

下载地址:

官方描述: You can use this plugin’s basic functionality to set up a list of frequently-accessed files for easy navigation. The list of files will be displayed in a window on the left side of the Vim window, and you can press or double-click on filenames in the list to open the files. This is similar to how some IDEs I’ve used work. I find this easier to use than having to navigate a directory hierarchy with the file-explorer. It also obviates the need for a buffer explorer because you have your list of files on the left of the Vim Window.

滇狐评价: 食之无肉,弃之有味。

安装注意事项: 几乎没怎么用过, 所以暂时没有发现需要注意的地方。

2 文档编写

2.1 VIM LaTeX Suite

下载地址:

官方描述:

Vim is undoubtedly one of the best editors ever made. LaTeX is an extremely powerful, intelligent typesetter. Vim-LaTeX aims at bringing together the best of both these worlds.

We attempt to provide a comprehensive set of tools to view, edit and compile LaTeX documents without needing to ever quit Vim. Together, they provide tools starting from macros to speed up editing LaTeX documents to compiling tex files to forward searching .dvi documents.

See the features page for a brief tour of the various features in LaTeX-suite. All these features can be tuned extensively using the included texrc file. The screenshots page shows you how a typical working session with LaTeX-suite might progress.

LaTeX-suite is made for Vim versions 6.0 and above. Installation instructions are given in the download page.

滇狐评价: 实在是非常非常非常非常好的一个插件! 用 VIM 写 LaTeX 的朋友无论如何都要试一试, 不用 VIM 写 LaTeX 的朋友也要试一试, 说不定你会改变你的主意, 改用 VIM 写 LaTeX。

安装注意事项: 如果使用 gvim 的话, 需要注意 scim 可能会和 LaTeX Suite 有冲突。 解决方法是要么把 scim 的 on the spot 功能去掉, 或者把 gtk_im_module 设为 scim。 (较新版本 scim 建议第二种方案)。

另外, 为了提高工作效率, 强烈建议配置 VIM 的功能。

2.2 sketch

下载地址:

官方描述: Sketch.vim C Line drawing/painting using the mouse. Based on an idea by Morris.

滇狐评价: 很好玩, 虽然用到的时候不多, 但真一旦用到了, 还是会觉得这个东西很有用的。

安装注意事项: 建议在 .vimrc 中把 call ToggleSketch() 映射为命令,方便一些:

command -nargs=0 ToggleSketch call ToggleSketch()

3 日常生活

3.1 Calendar

下载地址:

官方描述: This script create calender window. This don’t use the external program (cal).

滇狐评价: 安装完毕后使用 :Calendar 命令打开一个垂直的日历窗口, 使用 :CalendarH 命令打开水平的日历窗口。 应该还是比较有用的。

安装注意事项: 滇狐个人喜欢把日记的扩展名改成 .txt, 默认的是 .cal。 在 calendar.vim 里面查找替换一下就可以了。 另外, 可以在 .vimrc 里面修改日记所在的路径, 默认是 ~/diary。

let g:calendar_diary=<PATH>

3.2 vimtips

下载地址:

官方描述:

Whenever you start Vim (but no more than daily) the script will open a help window with a Vim tip. You must download the tips separately, from

After installation, you can get the next tip with

:TipOfTheDay

滇狐评价: 每天看一条,慢慢就变成 VIM 牛了。

安装注意事项: 暂时没发现。

3.3 

你现在看到的这张网页就是使用 制作的。 也许它不漂亮, 但是很清秀, 而且添加信息非常方便。 是 将滇狐从繁重的 Html 编辑工作中解放出来, 使滇狐有足够的勇气重新开始制作个人主页。 为了更好地说明 , 滇狐将该插件的使用单独放到中。

阅读(756) | 评论(0) | 转发(0) |
0

上一篇:vi 折叠

下一篇:vim 插件

给主人留下些什么吧!~~