Ubuntu16.04 安裝 YouComlpeteMe

YouCompleteMe是一個google開源的vim自動補全插件
源地址 https://github.com/Valloric/YouCompleteMepython

安裝步驟

  • 前期準備
    vim版本大於7.4.143
    安裝python2或3
    安裝Vundle神器
    安裝clang+llvm
  • 使用vundle安裝
    編輯~/.vimrc文件,添加
Plugin 'Valloric/YouCompleteMe'

進入vim,命令行模式輸入git

:PluginInstall

若是不能正常安裝,則需進入~/vim/bundle,執行github

git clone --recursive https://github.com/Valloric/YouCompleteMe.git

可能還須要多執行幾回才能把他完整clone下來vim

  • 編譯
    安裝cmake,python-dev或python3-dev
sudo apt-get install cmake
sudo apt-get install python-dev
sudo apt-get install python3-dev

若是須要C家族語言支持就google

cd ~/.vim/bundle/YouCompleteMe
./install.py --clang-completer

若是不須要C家族語言支持就插件

cd ~/.vim/bundle/YouCompleteMe
./install.py
  • 簡單配置
    ~/.vimrc文件中添加或修改:
let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py'

並在.ycm_extra_conf.py中添加須要輸入的時候查找提示的搜索路徑
好比:命令行

'isystem',
'/usr/include',
'isystem',
'/usr/local/include',

等。code

相關文章
相關標籤/搜索