vim中的杀手级插件: vundle

来源:互联网 发布:js n的阶乘 编辑:程序博客网 时间:2024/04/28 14:17

相比sublime text2等现代编辑器,Vim缺乏默认的插件管理器,所有插件的文件都散布在~/.vim下的几个文件夹中,配置vim的过程, 就是在网上不停的搜插件,拷贝到~/.vim下,发现更新,要重新下载重新拷贝,想要删除某个不需要插件,更是要小心翼翼的不要删错。配置出顺手的Vim, 需要极大的耐心和运气。

当然vim社区的活力是不容怀疑的,没有枪没有炮大神们自己造。以前使用过tpope的pathogen,使用git submodule和pathogen, 管理插件已经大大简化。而今天介绍的vundle, 更是把git操作整合进去,用户需要做的只是去Github上找到自己想要的插件的名字,安装,更新和卸载都可有vundle来完成了。虽然去发现一个好的插件仍然是一个上下求索的过程,但是用户已经可以从安装配置的繁琐过程解脱了。
Vundle的具体介绍查看vim.org,或者github repo

安装和配置

下载vundle

1
 $ git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle

在.vimrc 中添加bundle的配置

12345678910111213141516171819202122232425262728293031323334353637
set nocompatible                " be iMprovedfiletype off                    " required!set rtp+=~/.vim/bundle/vundle/call vundle#rc()" let Vundle manage VundleBundle 'gmarik/vundle'"my Bundle here:"" original repos on githubBundle 'kien/ctrlp.vim'Bundle 'sukima/xmledit'Bundle 'sjl/gundo.vim'Bundle 'jiangmiao/auto-pairs'Bundle 'klen/python-mode'Bundle 'Valloric/ListToggle'Bundle 'SirVer/ultisnips'Bundle 'Valloric/YouCompleteMe'Bundle 'scrooloose/syntastic'Bundle 't9md/vim-quickhl'" Bundle 'Lokaltog/vim-powerline'Bundle 'scrooloose/nerdcommenter'".................................." vim-scripts reposBundle 'YankRing.vim'Bundle 'vcscommand.vim'Bundle 'ShowPairs'Bundle 'SudoEdit.vim'Bundle 'EasyGrep'Bundle 'VOoM'Bundle 'VimIM'".................................." non github repos" Bundle 'git://git.wincent.com/command-t.git'"......................................filetype plugin indent on

bundle分为三类:
  1. 在Github vim-scripts 用户下的repos,只需要写出repos名称
  2. 在Github其他用户下的repos, 需要写出”用户名/repos名”
  3. 不在Github上的插件,需要写出git全路径

安装插件

打开一个vim, 运行:BundleInstall

或者在命令行运行 vim +BundleInstall +qall

安装完成后插件就能用了

其它常用命令:

  • 更新插件:BundleUpdate
  • 清除不再使用的插件:BundleClean,
  • 列出所有插件:BundleList
  • 查找插件:BundleSearch

几篇对比vim插件管理工具的文章:

  • 使用Vundle管理Vim插件
  • Vim的插件管理
  • vundle vs pathogen
0 0
原创粉丝点击