debian 如何编译安装 vim

用的系统有点老,自带的vim版本有点老,安装一个最新的vim。通过源代码安装。

下载和解压

wget https://github.com/vim/vim/archive/refs/tags/v8.2.3582.zip
unzip v8.2.3582.zip
cd vim-8.2.3582/

配置和安装


./configure --prefix=/usr/local/vim  \
--enable-cscope \
--enable-luainterp \
--enable-multibyte \
--enable-python3interp=yes

make && make install

检查版本

 /usr/local/vim/bin/vim --version
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Nov  5 2021 23:32:33)
Included patches: 1-3582

错误处理

如果遇到错误信息,安装相应的库一般可以解决

no terminal library found
checking for tgetent()... configure: error: NOT FOUND!
      You need to install a terminal library; for example ncurses.
      On Linux that would be the libncurses-dev package.
      Or specify the name of the library with --with-tlib.
[root@wpcode.cn vim-8.2.3582]$ apt-get install libncurses-dev -y