Vundle配置文件解析與使用指南

0.簡介

Vundle是Vim Bundle的縮寫,是一個Vim插件管理工具。

Vundle allows you to…

  • keep track of and configure your plugins right in the .vimrc
  • install configured plugins (a.k.a. scripts/bundle)
  • update configured plugins
  • search by name all available Vim scripts
  • clean unused plugins up
  • run the above actions in a single keypress with interactive mode

Vundle automatically…

  • manages the runtime path of your installed scripts
  • regenerates help tags after installing and updating

1.安裝方法

1.1 從git上拉取項目

git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim

1.2 將以下的配置命令放在.vimrc文件的最開頭。

" 表明不與Vi兼容,因爲如果與Vi兼容,很多強大的功能無法使用
set nocompatible              " be iMproved, required
filetype off                  " required

" set the runtime path to include Vundle and initialize
" running time path 的縮寫,即我們到哪裏去找插件
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'

" [Vim Markdown插件]
" vim高亮顯示Markdown語法
Plugin 'morhetz/gruvbox'
Plugin 'godlygeek/tabular'
Plugin 'plasticboy/vim-markdown'

" 不同形式的插件支持方式,各種形式的Plugin一定要在begin/end之間
" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.

" Github上的插件,直接寫賬戶/項目名就可以
" plugin on GitHub repo
Plugin 'tpope/vim-fugitive'

" vim-scriptes網站上插件
" plugin from http://vim-scripts.org/vim/scripts.html
Plugin 'L9'

" 也是git倉庫,但是不是Github上的插件,比如公司內的git倉庫
" 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

3.安裝

進入Vim,輸入命令。

:PluginInstall

在Vim最下邊會顯示processing等文字即表示在安裝。其他命令在上述配置當中的brief help中。

4.官方FAQ

官方FAQ和項目地址見這裏。https://github.com/VundleVim/Vundle.vim#docs


本文參考文獻亦是:https://github.com/VundleVim/Vundle.vim#docs

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章