- 安装需要类库或者软件, 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=~/software/vim \
--enable-pythoninterp=yes \
--enable-python3interp=yes \
--with-python-command=python \
--with-python3-command=python36
make && make install
- 加入path路径,在bashrc中添加如下
alias vim='~/software/bin/vim'
- 查看vim版本
vim --version
ref:https://www.vimtoo.com/defualt/69.html