Linux系统Vim安装YouCompleteMe插件教程(图)

原标题:”Linux系统Vim安装YouCompleteMe插件教程详解”相关电脑问题教程分享。 – 来源:路由器之家。LINUX相信很多用户都很少接触到,而技术人员或是IT人士就会经常接触。而在L

亲,以下就是关于(Linux系统Vim安装YouCompleteMe插件教程(图)),由“路由器之家”整理!

Linux系统Vim安装YouCompleteMe插件教程(图)

原标题:"Linux系统Vim安装YouCompleteMe插件教程详解"相关电脑问题教程分享。 – 来源:路由器之家。

  LINUX相信很多用户都很少接触到,而技术人员或是IT人士就会经常接触。而在Linux系统中想要让Vim编辑器发挥更大的作用,就要对给给它安装一些插件。比如说YouCompleteMe插件(名字就很形象)。下面,路由器之家小编就给大家介绍Linux系统Vim安装YouCompleteMe插件教程详解。

Linux系统

Linux系统

  编译配置选项:

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

  在我的机器上装有python2.7.5 和 python3.3, 但加了enable-python3interp参数依然没有支持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’

  保存退出,打开vim,输入 :BundleInstall 进行自动安装
[page]

  进程如下,+号表示已经安装,》表示正在安装。

  。 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

  结束时有个错误,这是正常的,因为ycm需要手工编译出库文件

  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

  参数是为了支持c/c++ 的补全。

  安装完成后进行一些简单的配置就可以使用。

  YouCompleteMe 的补全配置文件在/bundle/YouCompleteMe/cpp/ycm/.ycm_extra_conf.py,这是个隐藏文件。

  默认会使用这个文件,也可以把这个文件copy到工程的根目录中作修改,打开工程文件时会优先使用当前目录下的配置文件。

  如果找不到,会根据配置中的ycm_global_ycm_extra_conf 进行查找。

  在.vimrc 中添加

  let mapleader = ”,“ ” 这个leader就映射为逗号“,”

  let g:ycm_global_ycm_extra_conf = ‘~/.vim/bundle/YouCompleteMe/cpp/ycm/.ycm_extra_conf.py’ “配置默认的ycm_extra_conf.py

  nnoremap 《leader》jd :YcmCompleter GoToDefinitionElseDeclaration《CR》 “按,jd 会跳转到定义

  let g:ycm_confirm_extra_conf=0 “打开vim时不再询问是否加载ycm_extra_conf.py配置

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

  以上就是Linux系统Vim安装YouCompleteMe插件教程详解,

  相关内容推荐:详解Linux系统top命令的使用方法

以上就是关于-常见问题-(Linux系统Vim安装YouCompleteMe插件教程(图))的教程!

本文来自投稿,不代表路由百科立场,如若转载,请注明出处:https://www.qh4321.com/116600.html

(0)

相关推荐

  • win7系统下如何加快电脑运行速度(图)

    原标题:”win7系统下如何加快电脑运行速度”相关电脑问题教程分享。 – 来源:路由器之家。很多人都在表示疑问,为什么自己的win7系统电脑运行越来越慢了,特别是在升级补丁的时候,实在卡的无法动弹,

    2021年7月20日
  • 魔兽世界的截图快捷键

    路由器网投稿:文章是关于”魔兽世界的截图快捷键”的相关知识分享,希望可以帮到大家。 – 素材来源网络 编辑:小易。 魔兽世界是暴雪公司的开山之作…

    2022年8月26日
  • miui12mix3参数详情

    路由器网投稿:文章是关于"miui12mix3参数详情"的相关知识分享,希望可以帮到大家。 – 素材来源网络 编辑:小易。 mix2s是小米手机里非…

    2022年9月5日
  • 为什么路由器wan口认证失败?

    我的路由器设置后连不上网,在路由器的WAN口设置位置,显示已断开(认证失败)。请问wan口认证失败是怎么回事?现在要怎么设置,才能让路由器上网? 在设置路由器上网的时候,如果WAN口设置显示:已断

    2020年5月10日
  • 魔兽大脚怎么用不了

    路由器网投稿:文章是关于”魔兽大脚怎么用不了”的相关知识分享,希望可以帮到大家。 – 素材来源网络 编辑:小易。 很多用户们在玩耍魔兽怀旧服的时…

    2022年6月28日
  • 怎么修改路由器无线密码【图】

    当无线路由器密码遭到破解时,怎么修改路由器无线密码呢?下面为大家详细介绍一下,希望能对大家有所帮助。方法/步骤:下载安装浏览器,如下图所示:在浏览器地址栏输入路由器地址,如下图所示:在弹出框输入路由器

    2022年8月24日