在debian11中编译安装vim8.2

1.首先安装所有的必备的依赖库,包括git。

sudo apt install libncurses5-dev libgtk2.0-dev libatk1.0-dev \
libcairo2-dev libx11-dev libxpm-dev libxt-dev python2-dev \
python3-dev ruby-dev lua5.2 liblua5.2-dev libperl-dev git

2、卸载debian自带的vim

sudo apt remove vim vim-runtime gvim

3、设置系统的python3的目录。注意这个根据python的安装版本稍有不同,比我我安装的是python3.7,故目录是: /usr/lib/python3.7/config ,这里参考: https://github.com/ycm-core/YouCompleteMe/wiki/Building-Vim-from-source 

Note: If you are using Python, your config directory might have a machine-specific name (e.g. config-3.5m-x86_64-linux-gnu). 
Check in /usr/lib/python[2/3/3.5] to find yours, and change the python-config-dir and/or python3-config-dir arguments accordingly.

4、如果你想将来容易的卸载,请用checkinstall软件

sudo apt install checkinstall
cd ~/vim
sudo checkinstall

或者用通常的安装方法:

cd ~/vim
sudo make install

5、用update-alternatives设置vim作为默认的编辑器。

sudo update-alternatives --install /usr/bin/editor editor /usr/local/bin/vim 1
sudo update-alternatives --set editor /usr/local/bin/vim
sudo update-alternatives --install /usr/bin/vi vi /usr/local/bin/vim 1
sudo update-alternatives --set vi /usr/local/bin/vim

 6、编译完成的vim没有帮助文档,这个些文档在git的vim目录下面,把它复制到home目录里面就可以用了:

cp -r vim/runtime/doc ~/.vim/doc

 

posted @ 2022-03-28 12:29  立体风  阅读(822)  评论(0编辑  收藏  举报