首页 > 系统服务 > 详细

源码安装vim8

时间:2020-07-28 10:35:30      阅读:159      评论:0      收藏:0      [点我收藏+]

背景

突然想要试用youcompleteme插件,但是yum安装的vim版本太低了,于是索性直接从源码编译vim8来使用,中间遇到了一些问题,记录一下以备后续查阅。

安装

下载源码

git clone https://github.com/vim/vim.git

编译、安装

cd vim/src
make
make install

默认安装在/usr/local/bin/vim,由于之前的vim还没卸载,于是直接使用绝对路径打开新的vim8,报错:

YouCompleteMe unavailable: requires Vim compiled with Python (3.6.0+) support

提示没有添加python3支持,于是重新编译

./configure --enable-python3interp=yes
make
make install

重新使用绝对路径打开vim,报错消失了,成功打开。

配置youcompleteme

参考官方文档:https://github.com/ycm-core/YouCompleteMe#full-installation-guide
执行python3 install.py --all时报错:

Searching Python 3.7 libraries...
ERROR: found static Python library (/usr/local/lib/python3.7/config-3.7m-x86_64-linux-gnu/libpython3.7m.a) but a dynamic one is required. You must use a Python compiled with the --enable-shared flag. If using pyenv, you need to run the command:
  export PYTHON_CONFIGURE_OPTS="--enable-shared"
before installing a Python version.

原因:源码编译python3.7时没有添加--enable-shared选项,重新编译python3.7

make distclean
./configure --enable-shared --enable-optimizations
make 
make install

再执行python3 install.py --all成功。

安装好YCM之后,打开vim试一下,报错:

YouCompleteMe unavailable: /usr/local/lib/python3.7/lib-dynload/_socket.cpython-37m-x86_64-linux-gnu.so: undefined symbol: PyByteArray_Type

参考:
https://github.com/ycm-core/YouCompleteMe/wiki/Building-Vim-from-source

源码安装vim8

原文:https://www.cnblogs.com/lit10050528/p/13388769.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!