安装vim8.0可以先参考页面升级安装vim8.0并添加插件支持。
一、安装Lua和LuaJIT
LuaJIT下载页面:luajit.org,Lua下载页面:lua.org。
1.1 安装lua
1 2 3 4 5 |
wget https://www.lua.org/ftp/lua-5.3.4.tar.gz tar -zxvf lua-5.3.4.tar.gz cd lua make linux test make install |
1.2 安装LuaJIT
1 2 3 4 |
wget https://luajit.org/download/LuaJIT-2.0.5.tar.gz tar -zxvf LuaJIT-2.0.5.tar.gz cd LuaJIT-2.0.5 make && make install |
二、配置vim
安装lua库:apt-get install lua5.1-dev liblua5
,然后进入vim的安装目录安装:
1 2 3 4 5 6 7 8 9 10 |
./configure --prefix=/usr/local/vim-8.0 \ --enable-fail-if-missing \ --with-features=huge \ --enable-multibyte \ --enable-python3interp=yes \ --enable-luainterp=yes \ --enable-gui=gtk2 \ --enable-cscope \ --with-luajit \ --with-python3-config-dir=/usr/lib/python3.5/config-3.5m-x86_64-linux-gnu |
--enable-fail-if-missing
选项的作用:检测所有插件包的环境是否满足,不满足就停止。
这里如果出现错误则表示环境不满足,检查上面的步骤是否有误。没有错误就可以执行make && make intall
安装了。
安装完成后打开vim可能会报错:
1 |
vim: error while loading shared libraries: libluajit-5.1.so.2: cannot open shared object file: No such file or directory |
原因是找不到luajit的库,可以通过find / -name libluajit-5.1.so.2
来找到库:
1 2 3 4 |
root@ubuntu:~# find / -name "libluajit-5.1.so.2" /usr/local/lib/libluajit-5.1.so.2 # 找到库后做软链接 root@ubuntu:~# ln -s /usr/local/lib/libluajit-5.1.so.2 /usr/lib/libluajit-5.1.so.2 |
查看是否安装成功
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
root@ubuntu:/data/software# vim --version VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Apr 27 2018 15:43:37) Included patches: 1-1616 Compiled by ma@ubuntu Huge version without GUI. Features included (+) or not (-): +acl +farsi +mouse_sgr -tag_any_white +arabic +file_in_path -mouse_sysmouse -tcl +autocmd +find_in_path +mouse_urxvt +termguicolors -autoservername +float +mouse_xterm +terminal -balloon_eval +folding +multi_byte +terminfo +balloon_eval_term -footer +multi_lang +termresponse -browse +fork() -mzscheme +textobjects ++builtin_terms +gettext +netbeans_intg +timers +byte_offset -hangul_input +num64 +title +channel +iconv +packages -toolbar +cindent +insert_expand +path_extra +user_commands -clientserver +job -perl +vertsplit -clipboard +jumplist +persistent_undo +virtualedit +cmdline_compl +keymap +postscript +visual +cmdline_hist +lambda +printer +visualextra +cmdline_info +langmap +profile +viminfo +comments +libcall -python +vreplace +conceal +linebreak +python3 +wildignore +cryptv +lispindent +quickfix +wildmenu +cscope +listcmds +reltime +windows +cursorbind +localmap +rightleft +writebackup +cursorshape +lua -ruby -X11 +dialog_con +menu +scrollbind -xfontset +diff +mksession +signs -xim +digraphs +modify_fname +smartindent -xpm -dnd +mouse +startuptime -xsmp -ebcdic -mouseshape +statusline -xterm_clipboard +emacs_tags +mouse_dec -sun_workshop -xterm_save +eval -mouse_gpm +syntax +ex_extra -mouse_jsbterm +tag_binary +extra_search +mouse_netterm +tag_old_static system vimrc file: "$VIM/vimrc" user vimrc file: "$HOME/.vimrc" 2nd user vimrc file: "~/.vim/vimrc" user exrc file: "$HOME/.exrc" defaults file: "$VIMRUNTIME/defaults.vim" fall-back for $VIM: "/usr/local/vim-8.0/share/vim" Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 Linking: gcc -L/usr/local/lib -Wl,--as-needed -o vim -lm -ltinfo -lnsl -ldl -L/usr/lib/x86_64-linux-gnu -lluajit-5.1 -L/usr/lib/python3.5/config-3.5m-x86_64-linux-gnu/ -lpython3.5m |
评论