先推荐官方的 YouCompleteMe
中文 简洁的 YouCompleteMe
中文 详细的 YouCompleteMe
我自己走过的坑:
坑1.
File /home/w/.vim/bundle/YouCompleteMe/third_party/ycmd/build.py does not exist; you probably forgot to run:
git submodule update --init --recursive
提醒我 忘了运行这句话 ,但是运行 还是提醒 ,简直要崩溃
最后发现了我直接在github 下载解压的 ,编译少了很多东西。
还是要老老实实下载
$ git clone --recursive https://github.com/Valloric/YouCompleteMe.git ~/.vim/bundle/YouCompleteMe
$ cd ~/.vim/bundle/YouCompleteMe/
$ python3 install.py --clang-completer --system-libclang
坑2.https://www.cnblogs.com/20170722-kong/p/8046843.html
cp ~/.vim/bundle/YouCompleteMe/third_party/ycmd/examples/.ycm_extra_conf.py ~/.vim/
1. vim
https://github.com/Valloric/YouCompleteMe/wiki/Building-Vim-from-source
./configure --with-features=huge --enable-multibyte --enable-rubyinterp=yes --enable-pythoninterp=yes --with-python-config-dir=/usr/lib/python2.7/config --enable-python3interp=yes --with-python3-config-dir=/usr/lib/python3.5/config --enable-perlinterp=yes --enable-luainterp=yes --enable-gui=gtk2 --enable-cscope --prefix=/usr/local
bash: --with-python3-config-dir=/usr/lib/python3.5/config: No such file or directory
update-alternatives: error: alternative path /usr/local/bin/vim doesn't exist
update-alternatives: error: alternative /usr/local/bin/vim for editor not registered; not setting
解决:
sudo update-alternatives --config editor
sudo update-alternatives --install /usr/bin/editor editor /usr/local/bin/vim 0
4 /usr/local/bin/vim 0 manual mode
2. Vundle
在.vimrc 不装youcompleteme
Plugin 'VundleVim/Vundle.vim'd
Plugin 'tpope/vim-fugitive'
Plugin 'git://git.wincent.com/command-t.git'
Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
Plugin 'file:///Users/gmarik/path/to/plugin'
sudo vim +PluginInstall +qall
+号表示已经安装,>表示正在安装。
3.youcompleteme
Clang-complete是一个为c/c++而生的代码自动完成的插件.当我们输入.和->后,会给我们
http://releases.llvm.org/download.html 下载Ubuntu 16.04