vim bundle管理插件

来源:互联网 发布:Ubuntu16安装Apache 编辑:程序博客网 时间:2024/04/28 01:43
Vundle是基于Git仓库的插件管理软件。Vundle将插件的安装简化为类似yum软件安装的过程,只要:BundleInstall插件就安装完了,:BundleClean之后插件就卸载了。
一、Vundle的安装和使用
1. Vundle的安装
[ruby] view plaincopy在CODE上查看代码片派生到我的代码片
  1. $ git clone http://github.com/gmarik/vundle.git ~/.vim/bundle/vundle  

2. 更新.vimrc配置文件

[python] view plaincopy在CODE上查看代码片派生到我的代码片
  1. set nocompatible              " be iMproved  
  2. filetype off                  " required!  
  3.   
  4. set rtp+=~/.vim/bundle/vundle/  
  5. call vundle#rc()  
  6.   
  7. " let Vundle manage Vundle  
  8. " required!   
  9. Bundle 'gmarik/vundle'  
  10.   
  11. " 可以通过以下四种方式指定插件的来源  
  12. " a) 指定Github中vim-scripts仓库中的插件,直接指定插件名称即可,插件明中的空格使用“-”代替。  
  13. Bundle 'L9'  
  14.   
  15. “ b) 指定Github中其他用户仓库的插件,使用“用户名/插件名称”的方式指定  
  16. Bundle 'tpope/vim-fugitive'  
  17. Bundle 'Lokaltog/vim-easymotion'  
  18. Bundle 'rstacruz/sparkup', {'rtp''vim/'}  
  19. Bundle 'tpope/vim-rails.git'  
  20.   
  21. " c) 指定非Github的Git仓库的插件,需要使用git地址  
  22. Bundle 'git://git.wincent.com/command-t.git'  
  23.   
  24. " d) 指定本地Git仓库中的插件  
  25. Bundle 'file:///Users/gmarik/path/to/plugin'  
  26.   
  27. filetype plugin indent on     " required!  


3. 安装插件:
[python] view plaincopy在CODE上查看代码片派生到我的代码片
  1. :BundleInstall  

4. 卸载插件
如果要卸载插件就只需要删除.vimrc中的Bundle,然后在Vim中执行
[python] view plaincopy在CODE上查看代码片派生到我的代码片
  1. :BundleClean  

二、Vundle常用命令
[python] view plaincopy在CODE上查看代码片派生到我的代码片
  1. :BundleList              -列举列表(也就是.vimrc)中配置的所有插件  
  2. :BundleInstall          -安装列表中的全部插件  
  3. :BundleInstall!         -更新列表中的全部插件  
  4. :BundleSearch foo   -查找foo插件  
  5. :BundleSearch! foo  -刷新foo插件缓存  
  6. :BundleClean           -清除列表中没有的插件  
  7. :BundleClean!          -清除列表中没有的插件  

附:参考文献
Vundle项目
vim-scripts维护的GitHub repo

0 0