系統(tǒng)之家 - 系統(tǒng)光盤下載網(wǎng)站!

當(dāng)前位置:系統(tǒng)之家 > 系統(tǒng)教程 > Linux系統(tǒng)Vim安裝YouCompleteMe插件

Linux系統(tǒng)Vim如何安裝YouCompleteMe插件(2)

時(shí)間:2015-09-01 14:42:37 作者:zhijie 來源:系統(tǒng)之家 1. 掃描二維碼隨時(shí)看資訊 2. 請使用手機(jī)瀏覽器訪問: https://m.xitongzhijia.net/xtjc/20150901/56692.html 手機(jī)查看 評論

  進(jìn)程如下,+號表示已經(jīng)安裝,》表示正在安裝。

  。 Plugin ‘gmarik/vundle’ |~

  + Plugin ‘tpope/vim-fugitive’ |~

  + Plugin ‘Lokaltog/vim-easymotion’ |~

  + Plugin ‘tpope/vim-rails.git’ |~

  + Plugin ‘rstacruz/sparkup’ |~

  + Plugin ‘L9’ |~

  + Plugin ‘FuzzyFinder’ |~

  》 Plugin ‘git://git.wincent.com/command-|~

  t.git’ |~

  Plugin ‘file:///home/gmarik/path/to/pl|~

  ugin’ |~

  Plugin ‘Valloric/YouCompleteMe’ |~

  Helptags

  結(jié)束時(shí)有個錯誤,這是正常的,因?yàn)閥cm需要手工編譯出庫文件

  Done! With errors; press l to view log

  ycm_client_support.[so|pyd|dll] and ycm_core.[so|pyd|dll] not detected; you need

  to compile YCM before using it. Read the docs!

  到 .vim/bundle/YouCompleteMe 下跑

  。/install.sh --clang-completer

  參數(shù)是為了支持c/c++ 的補(bǔ)全。

  安裝完成后進(jìn)行一些簡單的配置就可以使用。

  YouCompleteMe 的補(bǔ)全配置文件在/bundle/YouCompleteMe/cpp/ycm/.ycm_extra_conf.py,這是個隱藏文件。

  默認(rèn)會使用這個文件,也可以把這個文件copy到工程的根目錄中作修改,打開工程文件時(shí)會優(yōu)先使用當(dāng)前目錄下的配置文件。

  如果找不到,會根據(jù)配置中的ycm_global_ycm_extra_conf 進(jìn)行查找。

  在.vimrc 中添加

  let mapleader = ”,“ ” 這個leader就映射為逗號“,”

  let g:ycm_global_ycm_extra_conf = ‘~/.vim/bundle/YouCompleteMe/cpp/ycm/.ycm_extra_conf.py’ “配置默認(rèn)的ycm_extra_conf.py

  nnoremap 《leader》jd :YcmCompleter GoToDefinitionElseDeclaration《CR》 “按,jd 會跳轉(zhuǎn)到定義

  let g:ycm_confirm_extra_conf=0 “打開vim時(shí)不再詢問是否加載ycm_extra_conf.py配置

  let g:ycm_collect_identifiers_from_tag_files = 1 “使用ctags生成的tags文件

  以上就是Linux給Vim安裝YouCompleteMe插件的方法了,YouCompleteMe插件號稱Vim自動補(bǔ)全神器,這個插件對Vim來說相當(dāng)重要。

標(biāo)簽 插件 vim

發(fā)表評論

0

沒有更多評論了

評論就這些咯,讓大家也知道你的獨(dú)特見解

立即評論

以上留言僅代表用戶個人觀點(diǎn),不代表系統(tǒng)之家立場

其他版本軟件

熱門教程

人氣教程排行

Linux系統(tǒng)推薦

掃碼關(guān)注
掃碼關(guān)注

掃碼關(guān)注 官方交流群 軟件收錄