centos 源代码安装 vim 8.1

Posted by

centos默认的版本是 7.4, 通过源代码安装的方式安装,更灵活,这里记录一下安装的方法。

vim8.1

查看 centos的版本

cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)

安装 epel 并,更新一下yum

yum install epel-release -y
yum update -y

安装需要类库或者软件, centos 默认安装有 python2, 这里让vim支持 python3

yum install -y git gcc-c++ ncurses-devel python-devel cmake wget make
yum install -y python36 python36-devel

源代码编译安装vim

cd ~
wget https://github.com/vim/vim/archive/v8.1.0000.tar.gz
tar xzf  v8.1.0000.tar.gz
cd vim-8.1.0000/

./configure --prefix=/usr/local/vim  \
--enable-pythoninterp=yes \
--enable-python3interp=yes \
--with-python-command=python \
--with-python3-command=python36

make && make install

加入path路径,并查看vim版本

echo "PATH=\$PATH:/usr/local/vim/bin" >> /etc/profile
. /etc/profile
vim --version

centos环境vim源代码安装

可以看到同时支持 python2python3

Leave a Reply

邮箱地址不会被公开。