? ? ? vim作為強(qiáng)大的編輯器工具骂束,開(kāi)發(fā)人員或其他使用者經(jīng)常借助插件增強(qiáng)其功能析二。本人屬非計(jì)算機(jī)專業(yè)的零基礎(chǔ)人員,在此記錄下一些最基本的vim相關(guān)知識(shí)作為自己的筆記按价,算是自己對(duì)知識(shí)的一種學(xué)習(xí)方法吧尘惧。
Vundle是 vim bundle的簡(jiǎn)寫(xiě)康栈,vim插件的管理工具。
安裝:
vundle.vim的安裝需要git喷橙,用如下命令進(jìn)行安裝:
$ git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
如果~/.vim/bundle不存在要先創(chuàng)建:mkdir -p ~/.vim/bundle
配置插件:
先在用戶家目錄下創(chuàng)建vim的配置文件.vimrc啥么,
$touch ~/.vimrc , 然后將以下內(nèi)容加入.vimrc贰逾,(注:加入的內(nèi)容只是用于演示的目的悬荣,不需要的插件可以移除):
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
安裝插件:
CLI中運(yùn)行vim,然后運(yùn)行:PluginInstall 疙剑, 也可直接在CLI中運(yùn)行vim +PluginInstall +qall 氯迂。
綜上所述,在git clone完成后言缤,插件的安裝基本分成兩步:
1 .先在.vimrc文件中配置要安裝的插件嚼蚀;
2. 在vim中運(yùn)行:PluginInstall 。