Windows下安装Vim插件管理Vundle

VIM是编辑器之神,这个就不用说了,越使用越会体会到VIM的强大与便利。但是它的强大建立在众多插件组合之上,而Vim本身缺乏对插件的有效管理,安装插件并配置_vimrc文件非常不便。gmarik受到Ruby的bunler的启发,开发了vundle这个vim插件,可以将插件分到不同的目录管理,更厉害的是可以很简单的添加需要安装的插件,然后通过指令简单的安装和更新,下面就介绍VIM和Vundle的安装。

1.安装Git

Vundle基于Git架构,每一个插件都是一个项目的Repository,通过Vundle可以用简单的指令,一键安装/更新/删除所有插件。

下载msysgit并安装(具体可见http://drupalchina.cn/content/windows-xi-tong-xia-gitan-zhuang-tu-jie),并将Git 的安装路径加入环境变量Path,如

[cpp]  view plain  copy
  1. D:\Program Files\Git\cmd  
然后运行cmd,输入
[cpp]  view plain  copy
  1. git --version  
如果能显示Git版本信息,说明安装成功。

2. 配置Curl脚本。

在Windows下还需要建立一个Curl脚本用于Vundle的远程链接。在Git的路径下新建一个空文本文件,改名为curl.cmd,编辑内容为

[cpp]  view plain  copy
  1. @rem Do not use "echo off" to not affect any child calls.  
  2. @setlocal  
  3.   
  4. @rem Get the abolute path to the parent directory, which is assumed to be the  
  5. @rem Git installation root.  
  6. @for /F "delims=" %%I in ("%~dp0.."do @set git_install_root=%%~fI  
  7. @set PATH=%git_install_root%\bin;%git_install_root%\mingw\bin;%PATH%  
  8.   
  9. @if not exist "%HOME%" @set HOME=%HOMEDRIVE%%HOMEPATH%  
  10. @if not exist "%HOME%" @set HOME=%USERPROFILE%  
  11.   
  12. @curl.exe %*  
保存后运行cmd,输入

[cpp]  view plain  copy
  1. curl --version  
如果可以看到版本信息说明配置成功。

3. 安装Vundle。

Git安装完成后,从官网Clone Vundle到Vim的安装路径下,如

[cpp]  view plain  copy
  1. git clone https://github.com/gmarik/vundle D:\Vim\vimfiles\bundle\vundle  
此时Vim的目录结构应该如下所示

D:Vim

+---vim73

+---vimfiles

      +---bundle

             +---vundle

                    +---autoload

4. 配置Vundle。

按照Vundle官方给出的配置,所有通过Vundle安装的插件会被安装到Windows的用户目录下,这里做了修改,直接安装到Vim目录下方便管理。

编辑_vimrc文件,加入

[cpp]  view plain  copy
  1. filetype off  
  2. " 此处规定Vundle的路径  
  3. set rtp+=$VIM/vimfiles/bundle/vundle/  
  4. call vundle#rc('$VIM/vimfiles/bundle/')  
  5. Bundle 'gmarik/vundle'  
  6. filetype plugin indent on  
  7.   
  8. " original repos on github<br>Bundle 'mattn/zencoding-vim'  
  9. Bundle 'drmingdrmer/xptemplate'  
  10.    
  11. " vim-scripts repos  
  12. Bundle 'L9'  
  13. Bundle 'FuzzyFinder'  
  14. Bundle 'bufexplorer.zip'  
  15. Bundle 'taglist.vim'  
  16. Bundle 'Mark'  
  17. Bundle 'The-NERD-tree'  
  18. Bundle 'matrix.vim'  
  19. Bundle 'closetag.vim'  
  20. Bundle 'The-NERD-Commenter'  
  21. Bundle 'matchit.zip'  
  22. Bundle 'AutoComplPop'  
  23. Bundle 'jsbeautify'  
  24. Bundle 'YankRing.vim'  
  25.    
  26. filetype plugin indent on     " required!   
5.安装插件

安装插件具体可看http://yp.oss.org.cn/blog/show_resource.php?resource_id=1561。

后面的链接是我的VIM配置文件:https://github.com/cgnerds/vim。

参考链接:

1 AlloVince的VIM配置方案:http://yp.oss.org.cn/blog/show_resource.php?resource_id=1561

2 使用Vundle来管理Vim插件:http://www.cnblogs.com/qiangji/archive/2011/07/31/Vundle.html

3. VIM之Vundle:http://blog.csdn.net/codebistu/article/details/8257138

4. 值得参考的VIM配置文件

https://github.com/asins/vim/blob/master/_vimrc

https://github.com/AlloVince/vim-of-allovince/blob/master/_vimrc

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值