佳木斯湛栽影视文化发展公司

主頁(yè) > 知識(shí)庫(kù) > Linux系統(tǒng)Vim編輯器如何安裝YouCompleteMe插件?

Linux系統(tǒng)Vim編輯器如何安裝YouCompleteMe插件?

熱門(mén)標(biāo)簽:家政服務(wù)網(wǎng)絡(luò) 美團(tuán) 服務(wù)器配置 電話(huà)機(jī)器人搭建 硅谷的囚徒呼叫中心 外呼系統(tǒng) 解決方案 百度競(jìng)價(jià)點(diǎn)擊價(jià)格的計(jì)算公式

  編譯配置選項(xiàng):

  /configure --with-features=huge --enable-pythoninterp --enable-python3interp --enable-luainterp --enable-multibyte --enable-sniff --enable-fontset

  在我的機(jī)器上裝有python2.7.5 和 python3.3, 但加了enable-python3interp參數(shù)依然沒(méi)有支持py3,不知何故,先不管,YouCompleteMe 只要求有py2.6以上。

  安裝vundle插件

  git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle

  在.vimrc中配置

  set nocompatible “ be iMproved, required

  filetype off ” required

  “ set the runtime path to include Vundle and initialize

  set rtp+=~/.vim/bundle/vundle/

  call vundle#rc()

  ” alternatively, pass a path where Vundle should install plugins

  “let path = ‘~/some/path/here’

  ”call vundle#rc(path)

  “ let Vundle manage Vundle, required

  Plugin ‘gmarik/vundle’

  ” The following are examples of different formats supported.

  “ Keep Plugin commands between here and filetype plugin indent on.

  ” scripts on GitHub repos

  Plugin ‘tpope/vim-fugitive’

  Plugin ‘Lokaltog/vim-easymotion’

  Plugin ‘tpope/vim-rails.git’

  “ The sparkup vim script is in a subdirectory of this repo called vim.

  ” Pass the path to set the runtimepath properly.

  Plugin ‘rstacruz/sparkup’, {‘rtp’: ‘vim/’}

  “ scripts from http://vim-scripts.org/vim/scripts.html

  Plugin ‘L9’

  Plugin ‘FuzzyFinder’

  ” scripts not on GitHub

  Plugin ‘git://git.wincent.com/command-t.git’

  “ git repos on your local machine (i.e. when working on your own plugin)

  Plugin ‘file:///home/gmarik/path/to/plugin’

  ” 。。。

  filetype plugin indent on “ required

  Bundle ‘Valloric/YouCompleteMe’

  保存退出,打開(kāi)vim,輸入 :BundleInstall 進(jìn)行自動(dòng)安裝

  進(jìn)程如下,+號(hào)表示已經(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í)有個(gè)錯(cuò)誤,這是正常的,因?yàn)閥cm需要手工編譯出庫(kù)文件

  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)行一些簡(jiǎn)單的配置就可以使用。

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

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

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

  在.vimrc 中添加

  let mapleader = ”,“ ” 這個(gè)leader就映射為逗號(hào)“,”

  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 會(huì)跳轉(zhuǎn)到定義

  let g:ycm_confirm_extra_conf=0 “打開(kāi)vim時(shí)不再詢(xún)問(wèn)是否加載ycm_extra_conf.py配置

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

  以上就是Linux給Vim安裝YouCompleteMe插件的方法了,YouCompleteMe插件號(hào)稱(chēng)Vim自動(dòng)補(bǔ)全神器,這個(gè)插件對(duì)Vim來(lái)說(shuō)相當(dāng)重要。

標(biāo)簽:邢臺(tái) 防城港 北海 韶關(guān) 烏蘭察布 撫州 臨沂 南昌

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《Linux系統(tǒng)Vim編輯器如何安裝YouCompleteMe插件?》,本文關(guān)鍵詞  ;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問(wèn)題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。
  • 相關(guān)文章
  • 收縮
    • 微信客服
    • 微信二維碼
    • 電話(huà)咨詢(xún)

    • 400-1100-266
    体育| 含山县| 温泉县| 梅河口市| 文水县| 兴化市| 大石桥市| 涿州市| 云龙县| 屏南县| 霍城县| 龙泉市| 奎屯市| 海宁市| 黄大仙区| 大理市| 富平县| 资溪县| 张家界市| 台江县| 哈密市| 兰溪市| 宜州市| 清水县| 新和县| 神木县| 荆州市| 闻喜县| 阳泉市| 金川县| 张家港市| 乌苏市| 堆龙德庆县| 郓城县| 四子王旗| 金川县| 杂多县| 连山| 桐柏县| 德庆县| 新野县|