YouCompleteMe is a fast, as-you-type, fuzzy-search code completion engine for Vimpython
听说YouCompleteMe是一个强大的自动补全插件,就试着安装一下,体验后确实不错,但安装过程也不是一路顺风的,总结一下过程,但愿下次再用时不要再跳坑喽。git
首先说下我本身的环境,系统是ubuntu16.04 LTS 64位,VIM版本为7.4.1689 -python +python3,VIM安装插件时使用VIM插件管理工具Vundle安装,假设vim已安装vundle插件管理工具(安装vundle也是很简单的,具体步骤请查看vundle官方说明github
Ensure that your version of Vim is at least 7.4.143 and that it has support for Python 2 or Python 3 scripting.ubuntu
Inside Vim, type :version. Look at the first two to three lines of output; it should say Vi IMproved X.Y, where X.Y is the major version of >vim. If your version is greater than 7.4, then you're all set. If your version is 7.4 then look below that where it says, Included patches: >1-Z, where Z will be some number. That number needs to be 143 or higher.vim
vim --version
, 而后查看第二行,包含补丁:1-Z,其中的Z即为补丁号vim --version grep python
,若是出现的python或python3前面有+号则知足条件,若是都是-号说明不知足条件,须要本身动手编译vim源码或下载7.4以上的版本。:version
,vim命令来查看,还能够使用:echo has('python') || has('python3')
,vim命令查看知足条件不。sudo apt-get install cmake build-essential python-dev python3-dev
来安装,其他系统能够参考YouCompleteMe插件官方说明安装的步骤仍是很简单的,关键是须要知足前提条件,若是不知足是确定过不去的。。。ide
在~/.vimrc的call vundle#end()以前添加Plugin 'Valloric/YouCompleteMe'
,而后保存,而后执行:source ~/.vimrc
vim命令,而后执行:PluginInstall
vim命令,最后就是等待VIM下载YouCompleteMe工具
下载完成后切换到vundle目录下的YouCompleteMe,如本机的
而后执行./install.py或./install.sh等待安装完成ui
安装完成后新建一个python文件,而后使用vim编辑一下吧,记得使用C-X C-O体验一下全能补全奥。。。插件
po一张最后的效果图
code