详细安装步骤在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, requiredfiletype off                  " required" set the runtime path to include Vundle and initializeset rtp+=~/.vim/bundle/Vundle.vimcall vundle#begin()" alternatively, pass a path where Vundle should install plugins"call vundle#begin('~/some/path/here')" let Vundle manage Vundle, requiredPlugin 'VundleVim/Vundle.vim'" The following are examples of different formats supported." Keep Plugin commands between vundle#begin/end." plugin on GitHub repoPlugin 'tpope/vim-fugitive'" plugin from http://vim-scripts.org/vim/scripts.html" Plugin 'L9'" Git plugin not hosted on GitHubPlugin '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 linecall vundle#end()            " requiredfiletype 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'" YouCompleteMeset runtimepath+=~/.vim/bundle/YouCompleteMelet g:ycm_collect_identifiers_from_tags_files = 1           " 开启 YCM 基于标签引擎let g:ycm_collect_identifiers_from_comments_and_strings = 1 " 注释与字符串中的内容也用于补全let g:syntastic_ignore_files=[".*\.py$"]let g:ycm_seed_identifiers_with_syntax = 1                  " 语法关键字补全let g:ycm_complete_in_comments = 1let g:ycm_confirm_extra_conf = 0let 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 = 1                          " 在注释输入中也能补全let g:ycm_complete_in_strings = 1                           " 在字符串输入中也能补全let g:ycm_collect_identifiers_from_comments_and_strings = 1 " 注释和字符串中的文字也会被收入补全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 = 0                           " 禁用语法检查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

转载于:https://www.cnblogs.com/wmjtxt/p/9040969.html

在deepin上安装YouCompleteMe相关推荐

  1. linux如何卸载lightdm,在Linux Deepin上安装Pantheon Lightdm主题

    Pantheon Lightdm 主题是由 Elementary OS 团队开发的一款 Lightdm 主题.下面,我们将为大家介绍如何在 Linux Deepin 上安装该 Lightdm 主题(理 ...

  2. linux自带浏览器如何更新,在deepin上安装edge浏览器后更新系统报错的解决方案

    有些人在deepin系统上安装完edge浏览器后采用sudo apt update命令更新系统,却报出了错误,更新失败.原因是更新deepin系统的时候,最好把其它的源禁用了,不然会有各样的问题. 报 ...

  3. 在windows和Deepin上安装Fedora33-KDE:一波三折、第九次成功的嘤嘤怪

    简介 首先硬盘上有windows,在此基础上安装了Linux Deepin.打算安装Fedroa33.下载了KDE和GNOME版本,两个Live都体验了一波,更喜欢KDE多一点,就装KDE版吧. 为什 ...

  4. Deepin上安装eclipse2021-03及其CDT插件

    文章目录 一.下载 二.安装 2.1 解压 2.2 设置环境变量 2.3 重启 三.配置 3.1 配置eclipse桌面图标 3.2安装Eclipse Marketplace 3.3安装SVN插件 3 ...

  5. 在CentOS 6.6 64bit上安装vim智能补全插件YouCompleteMe

    简介 YouCompleteMe是一个随键而动的.支持模糊搜索的.高速补全的插件.YCM由google公司搜索项目组的软件工程师Strahinja Val Markovic所开发,YCM后端调用lib ...

  6. deepin tim(wine)无法安装_利用HyperV虚拟机,如何在Win10上安装Deepin国产操作系统?深度好文!...

    随着老美对华为手机业务的封锁,在PC端的操作系统的未来也逐渐引起了人们的重视,一旦Windows停止向国内供应的话,对国内市场的冲击也是不小的.基于这个原因,国产操作系统也越来越频繁地进入大家的视野. ...

  7. deepin如何布署python_【玩转deepin】简单三步,教你在deepin15.11上安装Python3.7.4

    小编在论坛中看到有同学询问如何安装Python3.7,考虑到不少同学从panda进化到Lion后,也有了安装Python最新版本的需求,下面小编就来带着大家一起在deepin15.11上从源代码编译安 ...

  8. deepin终端编译c程序_在deepin linux上安装国人开发的编程语言-“明”语言

    闲来无事,在网上看到了介绍<>这篇文章,找到了它在gitcafe的地址:http://gkmail.gitcafe.io/ming/,这是国人开发的一个脚本语言,中文名称"明语言 ...

  9. 在VirtualBox上安装deepin

    前言:大家好,今天我来记录deepin的安装,与你共同学习.能看到这篇分享的你,想必对Linux的学习肯定也很感兴趣吧!这里给大家推荐一门我学习的Linux课程:<零基础学Linux操作系统&g ...

最新文章

  1. PHP:isset()-检测变量是否被设置
  2. 安卓安装完应用后,如何获取包的meta-inf目录下的文件?
  3. [OpenGL]未来视觉1-Android摄像头采集基础
  4. Win8Metro(C#)数字图像处理--2.24二值图像闭运算
  5. Spring boot使用Bootstrap
  6. 基于语言模型的少样本学习 / 深度学习优化器基准测试 | 本周值得读
  7. ITK:概念检查是同维的
  8. Maven打包小技巧--持续更新
  9. synchronized 王的后宫总管,线程是王妃
  10. 克隆的仓库 设置全局https协议转换成git协议,加快拉取速度(git)
  11. python实现批量修改文件夹的图片格式及大小
  12. Python读写Excel实现大量数据处理
  13. linux shell脚本攻略 第三章 以文件之名 find,chmod,touch,head,tail,tree,wc
  14. 在本地计算机无法启动错误1068,为什么本地计算机“无法启动Print Spooler服务,错误1068,依存服务或组无法启动”?...
  15. JQuery中$是什么?
  16. lustre lnet
  17. django-registration
  18. Java选择题(六)
  19. 零基础如何自学软件测试?2020软件测试学习路线
  20. 【JAVA】7-22 龟兔赛跑

热门文章

  1. python字符串函数运算_Python入门教程2. 字符串基本操作【运算、格式化输出、常用函数】 原创...
  2. 网络知识:视频监控传输带宽与存储容量的计算方法
  3. 网络知识:整理各种路由器组网方法!网跨段也能访问!
  4. 为什么说嵌入式开发比单片机要难很多?
  5. 嵌入式操作系统的主要特点都有哪些
  6. Linux中Shell的命令替换用法笔记
  7. Visual Studio Code 开发 .NET Core 看这篇就够了
  8. Chrome 调试技巧 1
  9. 今年最有档次的9个词!(不看后悔)
  10. java delphi aes加密算法_Delphi AES,又一个加密算法例子