vim 重新編譯,支援lua (compile vim with lua)

來源:互聯網
上載者:User

標籤:

1. ncurses 安裝

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

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

tar -xf ncurses-5.9.tar.gzcd ncurses-5.9./configuremakesudo make install

 

2. lua 安裝  

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

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

tar -xf lua-5.3.1.tar.gzcd lua-5.3.1make linuxsudo make install

 

問題一:

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

下載readline

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

cd readline-5.2./configuresudo makesudo make install

 

問題二:

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

 /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.bz2cd vim74./configure --prefix=/usr --with-features=huge --enable-rubyinterp --enable-pythoninterp --enable-luainterp --with-lua-prefix=/usr/local
sudo make
sudo make install

可以將輸出重新導向到log檔案中,查看configure輸出:

cat log | grep lua

[email protected]:~/vim74$ cat log | grep luachecking --enable-luainterp argument... yeschecking --with-lua-prefix argument... /usr/localchecking --with-luajit... nochecking for lua... /usr/local/bin/luachecking if lua.h can be found in /usr/local/include... yeschecking 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/vimsudo rm -f /usr/local/binsudo cp ~/vim74/src/vim /usr/binsudo cp ~/vim74/src/vim /usr/local/bin

vim 重新編譯,支援lua (compile vim with lua)

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.