目录

YCM git repo

https://github.com/Valloric/YouCompleteMe

YCM HomePage

https://valloric.github.io/YouCompleteMe/

Vundle git repo

https://github.com/VundleVim/Vundle.vim

材料

系统ubuntu18.04

补全语言C-family

vim --version 8.1

python3 -V 3.6

1,安装clang

ubuntu 系统没有预装clang,但是软件仓库有clang

这里采用命令行安装:

sudo apt install clang

安装完成后查看版本:

$ clang --version

clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)

Target: x86_64-pc-linux-gnu

Thread model: posix

InstalledDir: /usr/bin

2,安装YCM

使用Vundle安装

添加YCM插件名到vimrc中的Vundle插件安装区

'Valloric/YouCompleteMe'

Install Plugins:

Launch vim and run :PluginInstall

手动安装:

下载YCM

cd ~/.vim/bundle/
git clone https://github.com/Valloric/YouCompleteMe.git

下载YCM的依赖文件

git submodule update --init --recursive

3,编译YCM,支持 C-family languages:

cd ~/.vim/bundle/YouCompleteMe
python3 install.py --clang-completer

4,编辑vimrc

" ycm 指定 ycm_extra_conf.py
let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/third_party/ycmd/.ycm_extra_conf.py' " 禁用syntastic来对python检查 let g:syntastic_ignore_files=[".*\.py$"] " 使用ctags生成的tags文件
let g:ycm_collect_identifiers_from_tag_files = 1
" 开启语义补全 " 修改对C语言的补全快捷键,默认是CTRL+space,修改为ALT+;未测出效果
"let g:ycm_key_invoke_completion = '<M-;>' " 设置转到定义处的快捷键为ALT+G,未测出效果
"nmap <M-g> :YcmCompleter GoToDefinitionElseDeclaration <C-R>=expand("<cword>")<CR><CR> "关键字补全
"let g:ycm_seed_identifiers_with_syntax = 1 " 在接受补全后不分裂出一个窗口显示接受的项
set completeopt-=preview
" 让补全行为与一般的IDE一致 set completeopt=longest,menu " 不显示开启vim时检查ycm_extra_conf文件的信息
let g:ycm_confirm_extra_conf=0
" 每次重新生成匹配项,禁止缓存匹配项 let g:ycm_cache_omnifunc=0 " 在注释中也可以补全
let g:ycm_complete_in_comments=1
" 输入第一个字符就开始补全 let g:ycm_min_num_of_chars_for_completion=1 " 错误标识符
let g:ycm_error_symbol='>>'
" 警告标识符 let g:ycm_warning_symbol='>*' " 不查询ultisnips提供的代码模板补全,如果需要,设置成1即可
" let g:ycm_use_ultisnips_completer=0
let g:ycm_semantic_triggers = { 'c' : ['->', '.']}
"---------------------
"The g:ycm_key_list_select_completion option
"This option controls the key mappings used to select the first completion string. Invoking any of them repeatedly cycles forward through the completion list. let g:ycm_key_list_select_completion = ['<Enter>', '<Down>']

Ubuntu 安装YouCompleteMe的更多相关文章

  1. Ubuntu下如何安装YouCompleteMe插件

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

  2. Ubuntu Vim YouCompleteMe 安装

    0. 必要工具安装 sudo apt-get install build-essential cmake 1. 安装 vundle mkdir ~/.vim/bundle git clone http ...

  3. ubuntu 下安装 YouCompleteMe

    1.安装用到的软件包 sudo apt-get install vim sudo apt-get install git sudo apt-get install subversion sudo ap ...

  4. Mac OS、Ubuntu 安装及使用 Consul

    Consul 概念(摘录): Consul 是 HashiCorp 公司推出的开源工具,用于实现分布式系统的服务发现与配置.与其他分布式服务注册与发现的方案,比如 Airbnb 的 SmartStac ...

  5. ubuntu安装mysql

    好记性不如烂笔头,记录一下,ubuntu安装mysql的指令. 安装MySQL: sudo apt-get install mysql-server sudo apt-get install mysq ...

  6. ubuntu安装vim时提示 没有可用的软件包 vim,但是它被其它的软件包引用了 解决办法

    ubuntu安装vim时提示 没有可用的软件包 vim-gtk3,但是它被其它的软件包引用了 解决办法 本人在ubuntu系统安装vim  输入 sudo apt-get install vim 提示 ...

  7. docker 1.8+之后ubuntu安装指定版本docker-engine

    这边记录ubuntu安装过程,首先是官网文档 If you haven’t already done so, log into your Ubuntu instance. Open a termina ...

  8. debian/ubuntu安装桌面环境

    apt-get install xorg apt-get install gnome 然后startx ubuntu 安装Gnome桌面 1.安装全部桌面环境,其实Ubuntu系列桌面实际上有几种桌面 ...

  9. 一个ubuntu phper的自我修养(ubuntu安装)

    ubuntu安装篇 一.ubuntu下载 到ubuntu官网下载适合自己电脑配置的系统版本,此处不做展开. 二.制作USB启动盘 在windows下制作USB启动盘,工具是universal usb ...

随机推荐

  1. Laravel -- 邮箱功能配置问题

    ```` 今天碰到了这块的问题,还是记一下 ```` 关于邮箱: 品牌:腾讯qq.网易163 等 种类:个人.企业 邮箱服务器种类 配置教程 https://jingyan.baidu.com/art ...

  2. java 运算符的了解和运算符的优先级

    Java 语言支持如下运算符: 算术运算符: +,-,*,/,%,++,-- 赋值运算符 = 扩展赋值运算符:+=,-=,*=,/= 关系运算符: >,<,>=,<=,==,! ...

  3. vue路由守卫(全局守卫)

    router.beforeEach((to,from,next)=>{}) 回调函数中的参数, to:进入到哪个路由去, from:从哪个路由离开, next:函数,决定是否展示你要看到的路由页 ...

  4. java实现http请求

    String apiUrl = "https://api.seniverse.com/v3/weather/now.json?key=" + key + "&lo ...

  5. ffmpeg学习目录收集

    ffmpeg工具参数中文详细解释 雷霄骅 - [总结]FFMPEG视音频编解码零基础学习方法

  6. CAP分布式事务 学习及简单demo

    完全参考 github的指导 demo地址, Pub使用 efcore , Sub 使用 dapper, mysql数据库 https://files.cnblogs.com/files/xtxtx/ ...

  7. Python2还是Python3

    Python2还是Python3 相信很多新接触Python的人都会纠结这一个问题,学Python2还是Python3? 不像Java一样每个新版本基本都是基本兼容以前的版本的.Python2和Pyt ...

  8. [转]Windows 安装Kafka

    来源:https://www.cnblogs.com/liuyuhua/p/5329926.html https://www.cnblogs.com/xinlingyoulan/p/6054361.h ...

  9. matplotlib坐标轴设置续-【老鱼学matplotlib】

    本次会讲解如何修改坐标轴的位置. 要修改轴,就要先得到当前轴:plt.gca(),这个函数名挺怪的,其实是如下英文字母的首字母:get current axis,也就是得到当前的坐标轴. import ...

  10. react + axios实践

    本文只要介绍如何在项目中把react和axios结合起来使用,想了解更多关于axios详细知识以及api,可以到官网查看 https://www.npmjs.com/package/axios 首先安 ...