YouCompleteMe安装过程中会碰到很多坑,这里先说几个重点。这几个坑都被踩了一遍
1. vim version > v8.0
2. python >= v3.6
3. CMake > v3.14
4. gcc > v7.0 需要支持C++ 17
执行下面步骤之前,我是已经安装过YouCompleteMe,网上教程不要太多。。。自行度娘
1. 确认vim版本,以及是否支持python3.6
vim --verison
vim --version | grep python
//笔者这边不支持!卸载重新安装
dpkg -l | grep vim
apt-get remove vim-common vim-runtime vim-tiny
// 添加代理,根据需求自己更改
export http_proxy=***
export https_proxy=***
git clone https://github.com/vim/vim.git
./configure --with-features=huge \
--enable-multibyte \
--enable-pythoninterp=yes \
--enable-pythoninterp=no \
--enable-python3interp=yes \
--with-python3-command=/usr/bin/python3 \
--with-python3-config-dir=/usr/local/python3.6.5/lib/python3.6/config-3.6m-x86_64-linux-gnu \
--enable-rubyinterp=no \
--enable-perlinterp=no \
--enable-luainterp=no \
--enable-cscope \
--disable-gui \
--without-x \
--enable-fail-if-missing \
--prefix=/usr/local/vim8
make -j12
make install
//使用以下命令查看是否vim8.0, 以及是否支持python3.6
/usr/local/vim8/bin/vim --version | grep python
2. 运行vim 1.txt, 发现新的问题'ycmd'
YouCompleteMe unavailable: No module named 'ycmd'
cd ~/.vim/plugged/YouCompleteMe/
git submodule update --init --recursive
./install.sh --clang-completer
3. 运行步骤2,发现新的问题CMake的依赖
CMake 3.14 or higher is required. You are running version 3.13.0
// 下载CMake
tar -zxvf ./cmake-3.20.6.tar.gz -C ./cmake
cd ./cmake/cmake-3.20.6/
./bootstrap
make -j12
make install
camke --version
4. 运行步骤3,发现新的问题C++ 17的依赖
CMake Error at CMakeLists.txt:232 (message):
Your C++ compiler does NOT fully support C++17.
使用如下步骤更新,切记我们要替换为gcc 8.1
gcc更新版本(Your C++ compiler does NOT fully support C++11)_我的blog屋-CSDN博客