我的系统环境:
vim版本:8.0.x
iOS:10.13.1
安装Vundle
git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim
修改.vimrc文件,配置Plugins,在.vimrc文件中添加如下内容。
set nocompatible
filetype off
setrtp+=~/.vim/bundle/Vundle.vim
callvundle#begin()
Plugin 'gmarik/Vundle.vim'
call vundle#end()
filetype plugin indent on
安装YoucOompleteMe
在.vimrc中添加如下内容,位置在 call vundle#begin() 和 call vundle#end() 之间。
Bundle 'Valloric/YouCompleteMe'
因为YouCompleteMe的编译需要用到CMake,这里先用brew安装CMake.
brew install CMake
保存后重新打开vim,在正常模式下输入以下内容,开始安装YouCompleteMe
:BundleInstall
这里已经在安装YouCompleteMe了哟,静静地等待安装完成。
确诊仓库的完整性
git submodule update --init --recursive
进入到YouCompleteMe插件目录
cd .vim/bundle/YouCompleteMe
安装支持golang自动补全
./install.py --gocode-completer
其实还可以安装其它语言的自动实例,例如c语言:
./install.py --clang-completer