YCM安装以及遇到的坑

推荐文章:https://vimjc.com/vim-youcompleteme-install.html
1、版本支持:
在 Linux 终端输入 vim --version 可查看当前 Vim 的版本和编译信息

vim --version

2、安装依赖软件和库

sudo apt-get install build-essential cmake python-dev python3-dev

3、下载 YouCompleteMe 源码

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

获取 YouCompleteMe 的相关依赖 :

git submodule update --init --recursive

4、编译 YouCompleteMe

./install.py --clang-completer

5、配置~/.vimrc

~/.vimrc然后增加如下的语句(如果没有此文件,新建一个或者复制/usr/share/vim/vim81/vimrc_example.vim
.vimrc的引用逻辑为先从用户文件中寻找,如果没有的话再寻找usr文件夹。

Plugin ‘VundleVim/YouCompleteMe’
问题一:Linux Git could not resolve proxy:http
step1: Git 有自己的代理,重置一下 Git 的代理。

git config --global https.proxy ""
git config --global http.proxy ""

step2: 重置系统的代理:

export http_proxy=""
export https_proxy=""
export all_proxy=""

问题二:CMake Error at ycm/CMakeLists.txt:107 (file):
file DOWNLOAD HASH mismatch:第四布时出现问题。原因在于没有下载clang相关文件,从提示中推荐的网址,下载在~/.vim/plugged/中,再执行第四步即可。

CMake Error at ycm/CMakeLists.txt:123 (message):
  Cannot find path to libclang in prebuilt binaries


-- Configuring incomplete, errors occurred!
See also "/tmp/ycm_build_magkgtwt/CMakeFiles/CMakeOutput.log".
See also "/tmp/ycm_build_magkgtwt/CMakeFiles/CMakeError.log".
ERROR: the build failed.

NOTE: it is *highly* unlikely that this is a bug but rather
that this is a problem with the configuration of your system
or a missing dependency. Please carefully read CONTRIBUTING.md
and if you're sure that it is a bug, please raise an issue on the
issue tracker, including the entire output of this script
and the invocation line used to run it.

在这里插入图片描述
问题三:打开Vim时出现“NoExtraConfDetected: No .ycm_extra_conf.py file detected”
step1:
打开~/.vimrc,加上此行

let g:ycm_global_ycm_extra_conf='~/.ycm_extra_conf.py'

step2:
从官网下载.ycm_extra_conf.py文件并移动到/.ycm_extra_conf.py
官网网址:https://github.com/penincillin/vim/blob/master/ycm_extra_conf.py

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值