install vim with support for python

Remove vim packages

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

Dependencies:

python-dev
python3-dev
libncurses5-dev
git

Download sources:

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

update 2017-03-08 (lua + ruby + perl support):

$ sudo apt install liblua5.1-dev luajit libluajit-5.1 ruby-dev libperl-dev

$ sudo mkdir /usr/include/lua5.1/include
$ sudo ln -s /usr/include/lua5.1/*.h /usr/include/lua5.1/include/

$ make distclean
$ ./configure --enable-pythoninterp --with-python-config-dir=/usr/lib/python2.7/config-x86_64-linux-gnu --enable-python3interp --with-python-config-dir=/usr/lib/python3.5/config-3.5m-x86_64-linux-gnu --with-features=huge --enable-multibyte --with-x=yes --prefix=/usr --enable-largefile --enable-rubyinterp --enable-perlinterp --enable-luainterp --enable-cscope --enable-fail-if-missing --enable-fail-if-missing --with-lua-prefix=/usr/include/lua5.1 --enable-luainterp --with-luajit

$ sudo make
$ sudo make install

 

Support python2.7 and python3

$ ./configure \
--enable-pythoninterp \
--with-python-config-dir=/usr/lib/python2.7/config-x86_64-linux-gnu \
--enable-python3interp \
--with-python-config-dir=/usr/lib/python3.5/config-3.5m-x86_64-linux-gnu \
--with-features=huge \
--enable-multibyte \
--with-x=yes \
--prefix=/usr
$ make VIMRUNTIMEDIR=/usr/share/vim/vim74
$ su -c 'make install'

verificate support python

$ vim --version|grep --color -i python
you're looking +python

Set vim as your editor for default

# update-alternatives --install $(which editor) editor $(which vim) 40
# 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 )

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 )

Google+ photo

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

Conectando a %s