Vim是一個相似於Vi的著名的功能強大、高度可定製的文本編輯器,在Vi的基礎上改進和增長了不少特性。正是因爲其可定製的特性,html
許許多多的Vim插件便誕生了。管理這些插件又成爲咱們最爲頭疼的問題,最近無心中發現了Vundle----其特點在於使用git來管理插件,git
更新方便,支持搜索,一鍵更新,今後只須要一個vimrc走天下。那麼下面咱們就來看看如何安裝和配置Vundle:github
1.在用戶根目錄下建立.vim/bundle目錄(若是在用戶根目錄沒有的這些目錄的話)vim
2.將vundle拷貝到./vim/bundle中去:git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
app
3.配置vundle:在用戶根目錄下建立.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/'} " Avoid a name conflict with L9 Plugin 'user/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(安裝插件;添加「!」表示升級文件或者僅僅使用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(使用":h"查看幫助) " Put your non-Plugin stuff after this line
4.安裝插件:運行vim,以後運行":PluginInstall"命令便可安裝.vimrc文件中配置的插件網站
詳情請前往Vundle官方網站查看ui