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

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

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

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

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

  LINUX相信很多用户都很少接触到,而技术人员或是IT人士就会经常接触。而在Linux系统中想要让Vim编辑器发挥更大的作用,就要对给给它安装一些插件。比如说YouCompleteMe插件(名字就很形象)。下面,WiFi之家网小编就给大家介绍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.224m.com/116600.html

(0)
常见问题常见问题
上一篇 2021年8月16日 02:52
下一篇 2021年8月16日 02:55

相关推荐

  • Win7系统电脑总是断网解决方法(图)

    原标题:"Win7系统电脑总是断网怎么解决"相关电脑问题教程分享。 - 来源:WiFi之家网。win7系统下电脑总是突然断网,这是怎么回事呢?电脑总是断网怎么解决?特别是在下载和传输文件过程中,总是突然

    2021年7月16日
  • dropbox是啥(图文)

    【导读】dropbox是啥,下面就是WiFi之家网整理的网络知识百科,来看看吧!大家好,我是191路由器网小编,上述问题将由我为大家讲解。以网络为例,dropbox是一个网络硬盘,可以将你的任意资料保存

    2021年7月5日
  • 迅捷fw325r重置后不能联网怎么办?

    问:迅捷fw325r重置后不能联网怎么办?答:重置你的迅捷fw325r路由器之后,会删除之前所有的配置参数,所以就不能联网了。这时候,用电脑、手机登录到迅捷fw325r路由器的设置页面,重新设置上网参数、wifi名称和密码,完成设置后就能上网了。考虑到有些朋友没有电脑,所以下面鸿哥就演示介绍,重置迅

    2021年5月27日
  • 无线网无ip分配是什么意思(图文)

    【导读】无线网无ip分配是什么意思,下面就是WiFi之家网整理的网络知识百科,来看看吧!大家好,我是191路由器网小编,上述问题将由我为大家讲解。以手机为例,手机连接网络的时候显示无IP分配是表示当前路

    2021年8月5日
  • poe交换机和普通交换机区别有哪些

    【导读】poe交换机和普通交换机有什么区别,下面就是WiFi之家网整理的网络知识百科,来看看吧!大家好,我是191路由器网小编,上述问题将由我为大家讲解。poe交换机和普通交换机有什么区别是:POE交换

    2021年7月14日
  • Win7安装DreamweaverCS6提示错误代码0xc000007b解决方法(图)

    原标题:"Win7安装Dreamweaver CS6提示错误代码0xc000007b解决方法"相关电脑问题教程分享。 - 来源:WiFi之家网。众所周知,Dreamweaver CS6是重要的网站和移动

    2021年8月19日
  • 苹果系统装win7步骤图解

    原标题:"苹果系统如何装win7?苹果笔记本装win7教程"相关电脑问题教程分享。 - 来源:WiFi之家网。苹果系统如何装win7?目前,国内大部分使用苹果笔记本的人第一件事可能就是要求安装Windo

    2021年7月1日
  • 无线网英语是wi-fi吗(图文)

    【导读】无线网英语是wi-fi吗,下面就是WiFi之家网整理的网络知识百科,来看看吧!大家好,我是191路由器网小编,上述问题将由我为大家讲解。无线网英语是wi-fi。无线网络上网可以简单的理解为无线上

    2021年7月31日
  • Linux操作系统添加驱动模块教程

    原标题:"Linux操作系统添加驱动模块的详细步骤"相关电脑问题教程分享。 - 来源:WiFi之家网。操作系统是电脑中不可缺少的系统这样,现在很多人在使用Linux操作系统了。那么,Linux操作系统如

    2021年6月28日
  • Win10开机提示:dfrgfat.exe应用程序错误的解决方法(图)

    原标题:"Win10开机提示:dfrgfat.exe应用程序错误的解决方法"相关电脑问题教程分享。 - 来源:WiFi之家网。Win10开机提示:dfrgfat.exe应用程序错误怎么办?最近,很多用户

    2021年8月19日