Vundle是基於Git倉庫的插件管理軟件。Vundle將插件的安裝簡化爲類似yum軟件安裝的過程,只要:BundleInstall插件就安裝完了,:BundleClean之後插件就卸載了。
一、Vundle的安裝和使用
1. Vundle的安裝
[ruby] view plain copy
在CODE上查看代碼片派生到我的代碼片
$ git clone http://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
- 更新.vimrc配置文件
[python] view plain copy
在CODE上查看代碼片派生到我的代碼片
set nocompatible " be iMproved
filetype off " required!
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" let Vundle manage Vundle
" required!
Bundle 'gmarik/vundle'
" 可以通過以下四種方式指定插件的來源
" a) 指定Github中vim-scripts倉庫中的插件,直接指定插件名稱即可,插件明中的空格使用“-”代替。
Bundle 'L9'
“ b) 指定Github中其他用戶倉庫的插件,使用“用戶名/插件名稱”的方式指定
Bundle 'tpope/vim-fugitive'
Bundle 'Lokaltog/vim-easymotion'
Bundle 'rstacruz/sparkup', {'rtp': 'vim/'}
Bundle 'tpope/vim-rails.git'
" c) 指定非Github的Git倉庫的插件,需要使用git地址
Bundle 'git://git.wincent.com/command-t.git'
" d) 指定本地Git倉庫中的插件
Bundle 'file:///Users/gmarik/path/to/plugin'
filetype plugin indent on " required!
安裝插件:
[python] view plain copy
在CODE上查看代碼片派生到我的代碼片:BundleInstall
卸載插件
如果要卸載插件就只需要刪除.vimrc中的Bundle,然後在Vim中執行
[python] view plain copy
在CODE上查看代碼片派生到我的代碼片:BundleClean
二、Vundle常用命令
[python] view plain copy
在CODE上查看代碼片派生到我的代碼片
:BundleList -列舉列表(也就是.vimrc)中配置的所有插件
:BundleInstall -安裝列表中的全部插件
:BundleInstall! -更新列表中的全部插件
:BundleSearch foo -查找foo插件
:BundleSearch! foo -刷新foo插件緩存
:BundleClean -清除列表中沒有的插件
:BundleClean! -清除列表中沒有的插件
附:參考文獻
Vundle項目
vim-scripts維護的GitHub repo