VIM recompile, support for LUA (compile vim with LUA)

Source: Internet
Author: User
Tags lua readline
1. ncurses installation
Official website download: http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.9.tar.gz

CSDN download: http://download.csdn.net/detail/spch2008/8828779

tar -xf ncurses-5.9.tar.gz
cd ncurses-5.9
./configure
make
sudo make install
 

2. lua installation
Official website download: http://www.lua.org/download.html

CSDN download: http://download.csdn.net/detail/spch2008/8828787

tar -xf lua-5.3.1.tar.gz
cd lua-5.3.1
make linux
sudo make install
 

Question one:

error: readline / readline.h: No such file or directory

Download readline

CSDN download: http://download.csdn.net/detail/spch2008/8828777

cd readline-5.2
./configure
sudo make
sudo make install
 

Question two:

//usr/local/lib/libreadline.so: undefined reference to `tputs‘
//usr/local/lib/libreadline.so: undefined reference to `tgoto‘
//usr/local/lib/libreadline.so: undefined reference to `tgetflag‘
//usr/local/lib/libreadline.so: undefined reference to `UP‘
//usr/local/lib/libreadline.so: undefined reference to `tgetent‘
//usr/local/lib/libreadline.so: undefined reference to `tgetnum‘
//usr/local/lib/libreadline.so: undefined reference to `PC‘
//usr/local/lib/libreadline.so: undefined reference to `tgetstr‘
//usr/local/lib/libreadline.so: undefined reference to `BC‘
collect2: error: ld returned 1 exit status
Add -lncurses parameter

 /home/spch2008/lua-5.3.1/src/Makefile

linux:
110 $ (MAKE) $ (ALL) SYSCFLAGS = "-DLUA_USE_LINUX" SYSLIBS = "-Wl, -E -ldl -lreadline -lncurses"
 

3. vim installation
Official download: ftp://ftp.vim.org/pub/vim/unix/vim-7.4.tar.bz2

CSDN download: http://download.csdn.net/detail/spch2008/8828773

tar -xf vim-7.4.tar.bz2
cd vim74
./configure --prefix = / usr --with-features = huge --enable-rubyinterp --enable-pythoninterp --enable-luainterp --with-lua-prefix = / usr / local
sudo make
sudo make install
You can redirect the output to a log file and see the configure output:

cat log | grep lua

[email protected]: ~ / vim74 $ cat log | grep lua
checking --enable-luainterp argument ... yes
checking --with-lua-prefix argument ... / usr / local
checking --with-luajit ... no
checking for lua ... / usr / local / bin / lua
checking if lua.h can be found in / usr / local / include ... yes
checking if link with -L / usr / local / lib -llua is sane ... yes
 

problem:

objects / if_lua.o: In function `luaV_list_insert‘:
/home/spch2008/vim74/src/if_lua.c:777: undefined reference to `luaL_optlong‘
collect2: error: ld returned 1 exit status
Modify the file /home/spch2008/vim74/src/if_lua.c

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

 

4. Successful installation, detection time, may encounter problems
Open vim and enter: version to see the compilation time of vim. If it is generated by this compilation, then the instructions are correct, and then check if there is + lua.

If the compilation time is incorrect, delete the old vim and copy the new vim program

sudo rm -f / usr / bin / vim
sudo rm -f / usr / local / bin
sudo cp ~ / vim74 / src / vim / usr / bin
sudo cp ~ / vim74 / src / vim / usr / local / bin
vim recompile, support lua (compile vim with lua)
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.