源码编译Vim 8

Vim 8.0 在2016.09.12发布了, 在各 Linux 发行版还没更新包的时候就源码编译来使用吧! 以 Debian 编译 Vim 为例.

《源码编译Vim 8》

下载Vim 源码

可以在Vim 官网下载打包好的源代码.
或者使用 Git:

git clone https://github.com/vim/vim.git

编译

cd vim/src

./configure  --with-compiledby="TaoBeier" --with-features=huge --enable-pythoninterp=yes --with-python-config-dir=/usr/lib/python2.7/config-x86_64-linux-gnu  --enable-cscope --enable-perlinterp=yes --enable-rubyinterp=yes --with-luajit --enable-luainterp=yes --with-lua-prefix=/usr/include/lua5.1 --enable-multibyte --with-x --enable-fail-if-missing

上面的参数使用 ./configure --help 都可以看到对应用途. 上面使用的参数是增加了对 Python, Ruby, Perl, 以及X window的支持.

建议加上 --enable-fail-if-missing 参数, 以方便定位到哪里依赖缺失.

依赖

这里检查可能通不过, 首先是 lualuajit. 需要执行

sudo apt-get install lua5.1 liblua5.1-0 luajit libluajit-5.1-dev

其次注意 Python 的 config 位置.

最后就是 Perl 需要 sudo apt-get install libperl-dev.

最终

make && sudo make install

最终结果

《源码编译Vim 8》

PS: 其实我一开始是想介绍 Vim 8 的, 然后碰巧在 GitHub 上有人问如何编译之类的, 就先写了这篇.

可以通过公众号 TheMoeLove 和我联系

《源码编译Vim 8》

    原文作者:张晋涛
    原文地址: https://segmentfault.com/a/1190000007005137
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞