附:倉庫地址
附:我自用的vim配置文件,裏面註釋不少,僅供參考。html
Vundle是一款Vim的插件管理軟件(Linux),用起來很方便的緣由有幾點:git
請先自行安裝git。github
下載vundle到指定位置
$ git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
vim
在vimrc文件中添加以下代碼:網絡
set nocompatible " be iMproved, required filetype off " required " set the runtime path to include Vundle and initialize set rtp+=~/.vim/bundle/Vundle.vim call vundle#begin() " alternatively, pass a path where Vundle should install plugins "call vundle#begin('~/some/path/here') " let Vundle manage Vundle, required Plugin 'VundleVim/Vundle.vim' " The following are examples of different formats supported. " Keep Plugin commands between vundle#begin/end. " plugin on GitHub repo Plugin 'tpope/vim-fugitive' " plugin from http://vim-scripts.org/vim/scripts.html " Plugin 'L9' " Git plugin not hosted on GitHub Plugin 'git://git.wincent.com/command-t.git' " git repos on your local machine (i.e. when working on your own plugin) Plugin 'file:///home/gmarik/path/to/plugin' " The sparkup vim script is in a subdirectory of this repo called vim. " Pass the path to set the runtimepath properly. Plugin 'rstacruz/sparkup', {'rtp': 'vim/'} " Install L9 and avoid a Naming conflict if you've already installed a " different version somewhere else. " Plugin 'ascenator/L9', {'name': 'newL9'} " All of your Plugins must be added before the following line call vundle#end() " required filetype plugin indent on " required " To ignore plugin indent changes, instead use: "filetype plugin on " " Brief help " :PluginList - lists configured plugins " :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate " :PluginSearch foo - searches for foo; append `!` to refresh local cache " :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal " " see :h vundle for more details or wiki for FAQ " Put your non-Plugin stuff after this line
最後打開vim,輸入以下命令:
:PluginInstall
app
它如今正在根據vimrc中所指定的插件列表在自動下載並安裝插件了,過程可能比較久,慢慢等。ui
在安裝完成以後就可使用以下命令查看Vundle的一些使用方法:
:h vundle
this
經常使用命令有以下四個:
:BundleUpdate
更新插件
:BundleClean
清除再也不使用的插件
:BundleList
列出全部插件
:BundleSearch
查找插件,找到後按i
便可安裝spa
針對某個插件如ctrlp.vim,能夠用以下命令查看該插件的信息:
:h ctrlp
插件
注:
:PluginSearch
指令所找出來的插件都在vim-scripts,這個倉庫裏能夠找到一些插件的設置方法,文檔說明等。你可能會本身寫個插件,或者因爲種種緣由,沒法直接使用網絡方式安裝,而是經過本身下載好了插件再讓vundle管理,此時就須要另外的方法了。
首先是主題的安裝,好比喜歡用molokai
這種主題,先下載到molokai.vim
這個文件,這個文件你能夠去github或者其餘地方找到,而後拷到本機的.vim/colors/
目錄下,在.vimrc
中寫一句Plugin 'molokai'
就能夠了,這和在線安裝是同樣的,重啓下vim就生效,無需再去PluginInstall。
其次是其餘插件的安裝,先找到這個插件的整個文件夾,下載後放在.vim/bundle/
目錄下,直接整個文件夾放進去,而後在.vimrc
中寫一句Bundle 'xxx'
就好了。舉個例子,The-NERD-tree
這個插件用於在vim中查看目錄樹,若是想要離線安裝它,先從github上將倉庫clone下來,丟到.vim/bundle/
目錄下,在.vimrc
中寫上Bundle 'The-NERD-tree'
,重啓vim就生效。要注意,這樣其實插件仍是讓vundle管理的。