install vim with support for python 2.7/3.X and Lua

Last update: 29/03/2018

* remove vim:

$ sudo apt update
$ sudo apt purge $(dpkg --get-selections|grep -i vim|cut -f1)

* install the dependencies:

$ sudo apt update && sudo apt upgrade --yes
$ sudo apt install build-essential
$ sudo apt install python-dev python3-dev git
$ sudo apt-get install libncurses-dev libperl-dev ruby-dev liblua5.3-dev

* download sources:

$ cd /tmp/
$ git clone http://github.com/vim/vim.git
$ cd vim

* NOTE: In case of that sources was already existing:

$ cd src
$ make clean
$ cd ..
$ git pull

* fix liblua path

sudo ln -s /usr/include/lua5.?/ /usr/include/lua
sudo ln -s /usr/lib/x86_64-linux-gnu/liblua5.?.so /usr/local/lib/liblua.so

* configure and compiling sources:

$ ./configure \
--enable-pythoninterp=yes \
--with-python-config-dir=/usr/lib/python2.7/config-x86_64-linux-gnu \
--enable-python3interp=yes \
--with-python-config-dir=/usr/lib/python3.?/config-3.?m-x86_64-linux-gnu \
--with-features=huge \
--enable-multibyte \
--with-x \
--enable-luainterp=yes \
--enable-perlinterp=yes \
--enable-rubyinterp=yes \
--enable-cscope \
--enable-gui=auto \
--enable-fontset \
--enable-largefile \
--enable-terminal \
--disable-netbeans \
--enable-fail-if-missing \
--with-compiledby="jolth" \
--prefix=/usr
$ make
$ sudo make install

* Obtionally for make install

vim can be uninstalled again via dpkg -r vim using the tool checkinstall​.

$ sudo apt-get install checkinstall
$ sudo checkinstall

this create .deb file into directory.

* check the support for Python and Lua:

vim --version | grep --color -E 'lua|python'

you’re should see +python

* Set vim as your editor for default:

$ sudo update-alternatives --list editor
$ sudo update-alternatives --install $(which editor) editor $(which vim) 40
$ sudo update-alternatives --config editor

Reference
http://vi.stackexchange.com/questions/2403/vim-code-completion-for-python-3
https://github.com/Valloric/YouCompleteMe/wiki/Building-Vim-from-source
http://blog.sjas.de/posts/Compile-vim-on-Debian-7.html

Anuncios

Responder

Introduce tus datos o haz clic en un icono para iniciar sesión:

Logo de WordPress.com

Estás comentando usando tu cuenta de WordPress.com. Cerrar sesión /  Cambiar )

Google+ photo

Estás comentando usando tu cuenta de Google+. Cerrar sesión /  Cambiar )

Imagen de Twitter

Estás comentando usando tu cuenta de Twitter. Cerrar sesión /  Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Cerrar sesión /  Cambiar )

w

Conectando a %s