详细安装步骤在github上有,https://github.com/Valloric/YouCompleteMe,我这里是自己总结的简化版安装步骤。

步骤1.安装Vundle

首先,clone到本地

  • git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
  • 把以下内容复制到.vimrc:
  •   set nocompatible              " be iMproved, required
    filetype off " required " set the runtime path to include Vundle and initialize
    set rtp+=~/.vim/bundle/Vundle.vim
    call vundle#begin()
    " alternatively, pass a path where Vundle should install plugins
    "call vundle#begin('~/some/path/here') " let Vundle manage Vundle, required
    Plugin 'VundleVim/Vundle.vim' " The following are examples of different formats supported.
    " Keep Plugin commands between vundle#begin/end.
    " plugin on GitHub repo
    Plugin 'tpope/vim-fugitive'
    " plugin from http://vim-scripts.org/vim/scripts.html
    " Plugin 'L9'
    " Git plugin not hosted 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'
    " 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/'}
    " Install L9 and avoid a Naming conflict if you've already installed a
    " different version somewhere else.
    " Plugin 'ascenator/L9', {'name': 'newL9'} " All of your Plugins must be added before the following line
    call vundle#end() " required
    filetype plugin indent on " required
    " To ignore plugin indent changes, instead use:
    "filetype plugin on
    "
    " Brief help
    " :PluginList - lists configured plugins
    " :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
    " :PluginSearch foo - searches for foo; append `!` to refresh local cache
    " :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
    "
    " see :h vundle for more details or wiki for FAQ
    " Put your non-Plugin stuff after this line
  • Install Plugins: 打开vim执行:PluginInstall 或者直接输入命令sudo vim +PluginInstall +qall

步骤2.安装工具和cmake

  • sudo apt-get install build-essential cmake

步骤3.安装python-dev,python3-dev

  • sudo apt-get install python-dev python3-dev

步骤4.安装clang

  • sudo apt-get install clang

步骤5.编译

  • cd ~/.vim/bundle/YouCompleteMe
  • ./install.py --clang-completer
  • 如果编译出错执行:git submodule update --init --recursive

步骤6.复制以下内容到.vimrc中

  "----------------------------"
"------ YouCompleteMe -------"
"----------------------------"
let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/cpp/ycm/.ycm_extra_conf.py' " YouCompleteMe
set runtimepath+=~/.vim/bundle/YouCompleteMe
let g:ycm_collect_identifiers_from_tags_files = " 开启 YCM 基于标签引擎
let g:ycm_collect_identifiers_from_comments_and_strings = " 注释与字符串中的内容也用于补全
let g:syntastic_ignore_files=[".*\.py$"]
let g:ycm_seed_identifiers_with_syntax = " 语法关键字补全
let g:ycm_complete_in_comments =
let g:ycm_confirm_extra_conf =
let g:ycm_key_list_select_completion = ['<c-n>', '<Down>'] " 映射按键, 没有这个会拦截掉tab, 导致其他插件的tab不能用.
let g:ycm_key_list_previous_completion = ['<c-p>', '<Up>']
let g:ycm_complete_in_comments = " 在注释输入中也能补全
let g:ycm_complete_in_strings = " 在字符串输入中也能补全
let g:ycm_collect_identifiers_from_comments_and_strings = " 注释和字符串中的文字也会被收入补全
let g:ycm_global_ycm_extra_conf='~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py'
let g:ycm_show_diagnostics_ui = " 禁用语法检查
inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<CR>" | " 回车即选中当前项
nnoremap <c-j> :YcmCompleter GoToDefinitionElseDeclaration<CR>| " 跳转到定义处
"let g:ycm_min_num_of_chars_for_completion=2 " 从第2个键入字符就开始罗列匹配项

步骤7.出现的错误

我安装完以后,出现了以下错误:

YouCompleteMe unavailable: requires Vim compiled with Python (2.6+ or 3.3+)

解决办法:编译安装vim8.0,添加python支持

网址:在deepin上安装YouCompleteMe

在deepin上安装YouCompleteMe的更多相关文章

  1. Mac Yosemite上安装macvim和YouCompleteMe

    今天在macvim上安装YouCompleteMe的时候,碰到一个运行vim崩溃的错误.查了半天终于解决! 先上一下安装macvim的过程 # install xcode and command li ...

  2. windows7 Cygwin 下安装 YouCompleteMe 插件

    原创文章,欢迎指正!转载请注明~ 从上周就开始想在cygwin上安装YouCompleteMe插件,按照GITHUB上的官方教程安装,由于自己的理解失误,一直搞不清是按照在windows上安装还是按照 ...

  3. Ubuntu下如何安装YouCompleteMe插件

    Ubuntu安装YouCompleteMe插件 简介: 众所周知, Vim是一款linux下的文本编辑器, 其最基础的工作就是编辑文本,而不管该文本的内容是什么. 在Vim被程序员所使用后,其慢慢的被 ...

  4. centos安装youcompleteme

    哈哈,我又回来了,简单的重新装了一边虚拟机,又把vim配置了一遍,这回有信心把youcomplete的安装方法贴出来了,先给个权威的链接,然后给出具体步骤,保证没问题可以安装成功 http://www ...

  5. vim安装YouCompleteMe 插件

    要安装YouCompleteMe ,vim须支持python.看是否支持,可以在vim中:version 查看, 如果python前有+号,就是支持,减号就是不支持. 如果不支持,需要以编译安装方式重 ...

  6. Deepin Linux 安装JDK

    最近在自己的笔记本上安装了Deepin Linux,虽然使用过程中发现一些bugs,但是总体感觉还不错,准备把她作为开发系统使用.系统自带的JDK是Open JDK,但是在做JAVA开发的时候通常需要 ...

  7. 在ubuntu上安装k-vim

    在ubuntu 上安装k-vim 早就想好好改造一下自己使用的vim了!可惜各种配置都十分复杂,特别是涉及到C语言的语义补全,YouCompleteMe,总是出各种安装问题.今天有人推荐我使用k-vi ...

  8. 给vim安装YouCompleteMe

    要安装YouCompleteMe ,vim须支持python.看是否支持,可以在vim中:version 查看, 如果python前有+号,就是支持,减号就是不支持. 如果不支持,需要以编译安装方式重 ...

  9. Ubuntu14.04 32位安装Youcompleteme

    前一段时间在ubuntu16.04 64位上安装了vim插件Youcompleteme,花了两三天才弄好.今天在ubuntu14.04 32位上安装同样的插件,才知道之前所做的安装原来是多么的简单.今 ...

随机推荐

  1. javascript浏览器事件

    1.  Js浏览器对象层级结构:Window 窗口对象(location地址对象.document文档对象(Form表单对象(表单控件))) 2.  Window对象属性: 名称 描述 documen ...

  2. 【Android入门】一个App学会安卓开发

    一.程序项目架构

  3. 移动端,input、textarea滚动至可视区域

    1.一般情况下 在移动端,点击input框之后,会弹出输入键盘.而内容input的内容也会自动滚动到可视区域内. 2.当父元素设置了overflow属性之后 在设置了overflow属性之后,点击in ...

  4. android TextView加载html 过滤所有标签,保留换行标签

    情景: TextView加载后端接口获取到的html富文本 遇到的问题: 客户端通过接口取到的数据如下: <p style="margin-top: 0px; margin-botto ...

  5. Python爬虫从入门到进阶(4)之xpath的使用

    官网地址:https://lxml.de/xpathxslt.html 导入: from lxml import etree lxml.tree 支持 ElementTree 和 Element 上的 ...

  6. k8s部署etcd数据库集群

    ⒈下载 https://github.com/etcd-io/etcd/releases ⒉解压 tar -zxvf etcd-v3.3.12-linux-amd64.tar.gz ⒊移动可执行文件及 ...

  7. quart-process_bar

    import asyncio import random import aioredis import redis from quart import Quart, request, url_for, ...

  8. 微信中音乐播放在ios不能自动播放解决

    在微信中,ios手机下面音乐被自动禁掉无法自动播放,我们可以执行触发body上的元素,自动进行播放. //音乐 var x = document.getElementById("myAudi ...

  9. 开头不讲"Hello Word",读尽诗书也枉然 : Word 操作组件介绍 - Spire.Doc (转)

      [原文地址]http://www.cnblogs.com/liqingwen/p/5898368.html 序 本打算过几天简单介绍下组件 Spire.XLS,突然发现园友率先发布了一篇,既然 x ...

  10. python 字符串转化为json、post请求

    在json模块有2个方法, loads():将json数据转化成dict数据 dumps():将dict数据转化成json数据 load():读取json文件数据,转成dict数据 dump():将d ...