Ubuntu环境下以编译源码的方式安装Vim

目录

1. Ubuntu环境

2. 下载编译vim

2.1 效果截图 

3. 配置环境变量


1. Ubuntu环境

Linux chris-166 6.2.0-36-generic #37~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon Oct  9 15:34:04 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

2. 下载编译vim

// 源码下载
chris_166@chris-166:~/Tools/Vim$ git clone https://github.com/vim/vim.git

// 准备vim编译的依赖环境和对Python库的支持
chris_166@chris-166:~/Tools/Vim$ sudo apt install python3
chris_166@chris-166:~/Tools/Vim$ sudo apt install python3-dev
chris_166@chris-166:~/Tools/Vim$ sudo apt-get install libperl-dev
chris_166@chris-166:~/Tools/Vim$ sudo apt install build-essential python3-dev
// 支持C的外部lua库和正则表达式
chris_166@chris-166:~/Tools/Vim$ sudo apt install lua5.3 -y
chris_166@chris-166:~/Tools/Vim$ sudo apt install liblua5.3-dev -y
chris_166@chris-166:~/Tools/Vim$ sudo apt install libperl-dev -y

// 进入到vim源码里进行配置
chris_166@chris-166:~/Tools/Vim/vim$ ./configure \
--with-features=huge \
--prefix=/usr/local/vim \
--with-features=huge \
--enable-fail-if-missing \
--enable-luainterp \
--enable-perlinterp \
--enable-fontset \
--enable-python3interp \
--with-python3-command=python3

// 开始编译安装vim
chris_166@chris-166:~/Tools/Vim/vim$ sudo make -j8
chris_166@chris-166:~/Tools/Vim/vim$ sudo make install

2.1 效果截图 

1. ./configure xxx执行成功

 如果执行./configure报如下错误

checking if compile and link flags for Perl are sane... no: PERL DISABLED configure: error: could not configure perl

尝试如下方法解决 

chris_166@chris-166:~/Tools/Vim/vim$ sudo apt update

 chris_166@chris-166:~/Tools/Vim/vim$ sudo apt-get install libperl-dev

2.  sudo make install

3. 配置环境变量

通过上述的"./configure --prefix=/usr/local/vim \"可知其安装目录,接下来进入到"/usr/local/vim"检查下

chris_166@chris-166:/usr/local/vim$ echo 'export PATH="/usr/local/vim/bin:$PATH"' >> ~/.bashrc

至此vim编译安装完成

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值