原文链接:http://www.aisun.org/2017/10/vim+youcompleteme/

要安装YouCompleteMe ,vim须支持python。可以命令输入vim --version 查看, 如果python前有+号,就是支持,减号就是不支持。

如果不支持,需要以编译安装方式重新安装vim。

编译配置选项:

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

安装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 进行自动安装

+号表示已经安装,>表示正在安装;

在.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文件

重启vim之后出现需要更高版本的vim,需要先升级vim,

首先,要下载vim的源代码。

cd ~

git clone https://github.com/vim/vim.git

cd vim

进入源代码的src目录中,执行:
./configure --with-features=huge --enable-pythoninterp=yes --enable-cscope --enable-fontset --enable-perlinterp --enable-rubyinterp --with-python-config-dir=/usr/lib/python2.7/config --prefix=/usr/local
需要注意的是,不能写上--enable-gui,这是开启gui特性的,但是我们是在终端环境下安装的,因此不能开启这个特性,否则会出现编译错误。之后

cd ..

sudo make install

which vim

将src目录下编译好的vim执行文件替换上边which vim路径内的vim文件就升级ok了;

转载于:https://www.cnblogs.com/chuangshaogreat/p/7659824.html

vim 安装YouCompleteMe 插件相关推荐

  1. mac vim 安装 YouCompleteMe 插件自动补全

    前言 笔者常用vim进行c/c++/go开发,虽说vim也有自带自动补全(control+n,control+p),不过操作上还是比较麻烦,笔者希望可以实现,输入部分单词可以直接弹出下拉框提示所有可能 ...

  2. 给VIM安装YouCompleteMe插件

    VIM已有Vundle插件管理,以为安装比较简单,使用vundle安装的. 文件下载完毕提示没有YCM CORE.上网搜索下需要在插件目录编译,去YouCompleteMe的github可以看到有安装 ...

  3. VIM安装YouCompleteMe(Windows/Mac/Linux)

    VIM安装YouCompleteMe 前言 前一阵子一直在折腾YouCompleteMe这个插件,在Mac.Ubuntu.Windows上都试过,全部安装成功,其中 windows最费劲,今天也写出来 ...

  4. linux安装vi 插件,Ubuntu上Vim安装NERDTree插件的详细操作步骤

    NERDTree是Vim的文件系统浏览器,使用此插件,用户可以直观地浏览复杂的目录层次结构,快速打开文件以进行读取或编辑,以及执行基本的文件系统操作.NERDTree源码在https://github ...

  5. vim 安装YouCompleteMe 自动补全插件

    原文链接:http://www.zhiliaonote.com/2017/10/vim+youcompleteme/ 要安装YouCompleteMe ,vim须支持python.可以命令输入vim ...

  6. Vim 安装 YouCompleteMe

    Vim 下的自动补全,最好的工具莫过于 YouCompleteMe,官方文档在这里 http://valloric.github.io/YouCompleteMe/ 安装稍显复杂,以下记录我的过程. ...

  7. vim之YouCompleteMe插件配置

    入坑vim多天后逐步装插件对vim进行完善,终于今天开始尝试装最牛插件之一YouCompleteMe.一路也是遇到不少问题,甚至想从源码编译,最后发现其实都是些小问题. 本系统为ubuntu 先上插件 ...

  8. VIM安装YCM插件的详细步骤

    文章目录 前言 VIM版本 安装YCM依赖的软件和库 安装Vundle 安装YCM 下一步配置 效果图 参考博客 前言 据说youcompleteme是最难安装的插件,我在想网上找到一篇博客就能够安装 ...

  9. Ubuntu上Vim安装NERDTree插件操作步骤

    NERDTree是Vim的文件系统浏览器,使用此插件,用户可以直观地浏览复杂的目录层次结构,快速打开文件以进行读取或编辑,以及执行基本的文件系统操作.NERDTree源码在https://github ...

最新文章

  1. DG1062可编程信号源
  2. 用户识别率提升 25 倍 | 看神策数据如何利用 ID-Mapping 激活全域营销
  3. 过于离谱,我实现憋不住了!
  4. unity案例入门(二)(坦克大战)
  5. .NET 6 Preview 6 Released
  6. 现代程序设计 作业 2
  7. 85岁院士的新年浪漫:这大概是最美好的爱情
  8. C++设计模式-享元模式
  9. 移动计算云分布式数据缓存服务,实现快速可靠的跨区域多活复制
  10. CentOS6.5下的Nagios安装配置详解(图文)
  11. vss 2005 配置服务器端的时候提示IIS没有安装
  12. 医疗器材行业如何利用三类医疗器械进销存软件
  13. 电脑主板元件判断方法
  14. Android吃透inflate方法(二)
  15. UVA 10041-Vito's Family
  16. 【自然语言处理】【多模态】CLIP:从自然语言监督中学习可迁移视觉模型
  17. PB proUSB门锁接口函数例程
  18. Excel如何提取单元格中最后一次出现的数值
  19. 香港科技大学委任汪扬教授为副校长(大学拓展)
  20. 数据库应用(mysql)数据库管理

热门文章

  1. RK3399 Android 7.1开发准备
  2. 定义由4条线和4个圆弧组成的Box类,绘制一个圆角矩形(可填充)。
  3. 如何画一条0.5px的边(细线)
  4. Python|用turtle画笔画爱心
  5. SmartScore 64 Professional Edition v11.3.76 WiN 专业乐谱扫描识别软件
  6. 漫画安全HIDS、EDR、NDR、XDR
  7. linux下C语言抓包程序,带图形界面
  8. window7系统电脑,怎么调亮度?
  9. 制造业和物流行业的WMS系统差别在哪?
  10. linux服务器防御ddos,linux如何防御ddos