https://github.com/VundleVim/Vundle.vim
http://www.jianshu.com/p/d908ce81017a?nomobile=yes
http://www.bubuko.com/infodetail-446364.html
步骤
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.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'
Plugin ‘Valloric/YouCompleteMe‘
" 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
就会开始自动安装vundle指定的各种插件。
由于要安装clang等,安装过程是非常久的,大概需要一个小时,这个时间完全可以去做些别的。
等安装好后,在.vim/vundle/YouCompleteMe目录下多了一堆目录和文件。
3. 使用YouCompleteMe
YouCompleteMe进行补全时需要查找一个 ycm_global_ycm_extra_conf文件。可以每次在工作目录中放置这个文件,也可以设置全局。全局设置要在.vimrc中添加一行
let g:ycm_global_ycm_extra_conf=‘~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py‘