1. Build步骤

git clone --depth 1  https://github.com/vim/vim.git  # download the source code
cd vim/src
make distclean     # clean workspace if you build vim before
./configure --enable-pythoninterp --enable-rubyinterp  --enable-python3interp \
--enable-perlinterp --enable-luainterp --with-compiledby --enable-tclinterp  # can be ommited if do not used these features
make
sudo make install   # install the build bin to system file path

注意
1) Build 之前可以先把旧版本的vim卸掉
sudo apt-get remove vim-common vim-gnome vim-runtime vim-tiny vim-gtk
2) 安装Build vim需要的依赖 (未确认不安装是否可以)
sudo apt-get build-dep vim (若有依赖问题用aptitude来解决)
3) 若提示需要安装ncurses,执行命令即可:sudo apt-get install libncurses-dev
4) 若需要安装到不同的目录(默认是/usr/local/bin),configure是加上参数 --prefix=/somewhere/else/than/usr/local

2. 如何确认Build成功呢:

1) 打开vim,界面显示 version 7.4.2161 (最新的版本号)
2) vim --version 检测版本号以及compile时间
    VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Aug  6 2016 16:04:21)
    ...
3) :version  同样检测版本号以及compile时间

version 7.4.1529 (before)
version 7.4.2161 (now)
version 7.4.1655 (macvim)

最新版本不稳定,gvim会出现光标停留的问题,经测试,7.4.1655版本可以用。

3. 怎么制作deb安装包呢?

./configure        # 按上面的做法加上必要的参数
make               # Build
sudo checkinstall -D
make install # create a deb and install to system (Updated)

它会在当前目录下生成一个*.deb的文件,然后也默认安装到系统中去了。copy到别的电脑,sudo dpkg -i *.deb就能安装vim了。

4. 一些感想
很开心,一直困扰我的gvim选择时丢掉最后一个字符的bug终于不存在了,还有,我终于学会怎么从源码Build vim了,这就意味着我可以随时保证我的vim是最新版本的,一旦有什么bug修复,我都能及时更新我的vim!


Refer to:
1. https://daixiecode.com/2017/build-pack-vim/



相关文章:

  • 2022-12-23
  • 2021-07-12
  • 2022-12-23
  • 2022-01-29
  • 2022-12-23
  • 2022-01-13
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案