vim支持lua

1. ncurses 安裝

官網下載:http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.9.tar.gzcss

CSDN 下載:http://download.csdn.net/detail/spch2008/8828779html

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

 

2. lua 安裝  

官方網下載:http://www.lua.org/download.htmlpython

CSDN 下載:http://download.csdn.net/detail/spch2008/8828787linux

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

 

問題一:ubuntu

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

下載readlineruby

CSDN下載:http://download.csdn.net/detail/spch2008/8828777ssh

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

 

問題二:ui

//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

添加 -lncurses 參數lua

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

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

 

3. vim 安裝

官方下載:ftp://ftp.vim.org/pub/vim/unix/vim-7.4.tar.bz2

CSDN下載: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/localsudo makesudo make install

能夠將輸出重定向到log文件中,查看configure輸出:

cat log | grep lua

spch2008@ubuntu:~/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

 

問題:

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

修改文件 /home/spch2008/vim74/src/if_lua.c

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

 

4. 安裝成功,檢測時間,可能遇到問題

打開vim,輸入:version, 查看vim編譯時間,若是是本次編譯生成,則說明正確,而後查看是否有+lua。

若編譯時間不正確,則刪除舊vim,拷貝新的vim程序

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
相關文章
相關標籤/搜索