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插件教程(图))的教程!

阅读剩余 75%

原创文章,作者:常见问题,如若转载,请注明出处:https://www.224m.com/116600.html

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

相关推荐

  • 3g4g哪个网速快(图文)

    【导读】3g4g哪个网速快,下面就是WiFi之家网整理的网络知识百科,来看看吧!大家好,我是191路由器网小编,上述问题将由我为大家讲解。4G网速快,4G通信技术是第四代的移动信息系统,是在3G技术上的

    2021年8月5日
  • dns故障无法上网(图文)

    【导读】dns故障无法上网,下面就是WiFi之家网整理的网络知识百科,来看看吧!大家好,我是191路由器网小编,上述问题将由我为大家讲解。dns故障无法上网通常不是dns故障,而是网络本身就不通。如果仅

    2021年7月27日
  • 连接路由器上不了网怎么办

    在我的日常网络维护工作经验中,有的时候会出现这种情况:网络确定是正常的,路由器连接正常,但是不能上网。解决方法:一,家庭个人网路1、将插在路由器wan口上的网线直接插在电脑上,拨号后,看看是否能上网

    2020年6月17日
  • 如何查看自己的路由器IP地址

    很多人买了路由器,把路由器装好后不知道路由器在哪里设置,也就是说不知道路由器的IP网关地址,那么今天就教大家如何快速的

    常见问题 2020年9月4日
  • 家庭网络拓扑结构图

    【导读】家庭网络拓扑结构是,下面就是WiFi之家网整理的网络知识百科,来看看吧!大家好,我是191路由器网小编,上述问题将由我为大家讲解。家庭网络拓扑结构是星型。  拓扑这个名词是从几何学中借用来的。网

    2021年7月12日
  • 轻松几招在电脑查看曾经连接过的WIFI密码。

    一般电脑都会连接过很多路由器,每当我们想知道曾经连接过的WIFI密码的时候都不知道怎么操作,下面小编教你几招轻松知道曾

    常见问题 2020年8月17日
  • win10关闭自动更新怎么操作win10关闭更新的方法(图)

    原标题:"win10关闭自动更新怎么操作 win10关闭更新的方法"相关电脑问题教程分享。 - 来源:WiFi之家网。windows 10自动更新给不少用户造成困扰,很多系统的更新都是不是所必须的,有时

    2021年7月14日
  • 系统文件字体怎么改

    【导读】系统有哪些文件字体?相关系统问题,下面WiFi之家网小编为大家详细解答。系统中的中文字体:仿宋、黑体、华文彩云、华文细黑、华文新魏、华文行楷、华文中宋、楷体、隶书、幼圆
    系统中默认的英文字体:

    常见问题 2021年8月5日
  • 电脑虚拟内存不足的原因分析(图)

    原标题:"电脑虚拟内存不足的原因分析"相关电脑问题教程分享。 - 来源:WiFi之家网。很多人在使用电脑的过程中,都有遇到过系统提示虚拟内存不足的情况,导致许多程序无法正常运行。那么,电脑虚拟内存不足要

    2021年8月13日
  • Win10系统提示onedrive - 未登录且图标为灰色(图)

    原标题:"Win10系统提示“onedrive - 未登录”且图标为灰色"相关电脑问题教程分享。 - 来源:WiFi之家网。近来,有些从Win7系统升级到win10正式版的用户反馈,自己在使用微软帐户登

    2021年7月7日