VIM的重新编译,支持lua(安装 neocomplete时需要)

         想要成功安装neocomplete,需要vim是7.3及以上的版本,并且支持lua,查看是否支持,打开vim,输入:version,可以查看到版本和是否支持lua,如果-lua代表不支持,+lua代表支持,重新编译如下。

1. 下载安装ncurses

下载地址:http://ftp.gnu.org/pub/gnu/ncurses/

[[email protected] local]# tar -xzvf ncurses-6.1.tar.gz 

[[email protected] local]# cd ./ncurses-6.1/

[[email protected] ncurses-6.1]# ./configure

[[email protected] ncurses-6.1]# make

[[email protected] ncurses-6.1]# make install


2. 下载安装lua

下载地址:http://www.lua.org/download.html

[[email protected] local]# tar -xzvf lua-5.3.4.tar.gz 

[[email protected] local]# cd ./lua-5.3.4/

[[email protected] lua-5.3.4]# make linux

[[email protected] lua-5.3.4]# make install

注意:如果提示错误lua.c:82:31: fatal error: readline/readline.h: No such file or directory

需要先安装readline-devel

[[email protected] lua-5.3.4]# yum install readline-devle


3. 下载安装vim

下载地址:ftp://ftp.vim.org/pub/vim/unix/vim-7.4.tar.bz2

[[email protected] local]# tar -xjvf vim-7.4.tar.bz2 

[[email protected] local]# cd ./vim74/

[[email protected] vim74]# ./configure --prefix=/usr --with-features=huge --enable-rubyinterp --enable-pythoninterp --enable-luainterp --with-lua-prefix=/usr/local

[[email protected] vim74]# make

[[email protected] vim74]# make install


问题:

/usr/local/vim74/src/if_lua.c:777: undefined reference to `luaL_optlong'

[[email protected] vim74]# vim /usr/local/vim74/src/if_lua.c

找到777行

long pos = luaL_optlong(L, 3, 0);

修改为

long pos = (long) luaL_optlong(L, 3, 0);


4. 测试

是否安装成功,打开vim,输入:version

[[email protected] vim74]# vim

VIM的重新编译,支持lua(安装 neocomplete时需要)


5. 如何安装neocomplete请参考

https://blog.csdn.net/pei2215015/article/details/79802351中的安装neocomplete小节