SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2013-01-04 19:49:55

fabietto0102
Member
Registered: 2012-04-04
Posts: 26

VIM with Python

Hello, after much reading and much searching, I decided I'd use VIM for my python coding. I've come across howtos like this one VIM as Python IDE and it's all so beautiful and cool but... I don't know how to compile VIM, or to add these plugins. I have been reading that it's important to have the +python rather then -python:

fabio@crunchbang: ~ $ vim --version

[...] -python -python3 [...]

Can a kind soul teach me how to install vim with python support and how to install a plugin in #! please?

Thanks, once I get all the info together I'll write a nice howto for fellow developers who want to try vim!

Offline

Be excellent to each other!

#2 2013-01-04 20:36:01

fabietto0102
Member
Registered: 2012-04-04
Posts: 26

Re: VIM with Python

Maybe vim-nox is my answer? As per compiling vim from scratch, this is the info I found, not sure if it is correct?

First, install python-dev from the repos, then compile&configure from the source code:

apt-get install python-dev

cd ~/
mkdir src
cd src
wget ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2
tar -xf vim-7.3.tar.bz2
cd vim73xxx
./configure --enable-perlinterp --enable-pythoninterp --enable-rubyinterp --enable-cscope  --with-features=huge --prefix=/home/fabio/
make
make install

Still don't know how to install plugins though..

Offline

#3 2013-01-04 22:06:46

njonaitis
New Member
Registered: 2012-10-13
Posts: 5

Re: VIM with Python

Well, you don't need these to enable python support in Vim:

--enable-rubyinterp --enable-perlinterp

I think these flags are sufficient (cd to the directory where you have extracted Vim's source code first):

./configure --with-features=huge --enable-pythoninterp --with-python-config-dir=your_python_config_dir

Just change your_python_config_dir to your python installation's config dir. It's usually /usr/lib/python2.6/config or /usr/lib/python2.7/config, depending on your version of python. You may also need to have 'libncurses5-dev' installed.

After the configuration is finished:

sudo make install

If you need python3 support too, you'll need to add

--enable-python3interp --with-python3-config-dir=your_python3_config_dir

flags to the configuration line, with your_python3_config_dir pointing to your python3 configuration directory.

See if it helps wink

Offline

#4 2013-01-05 17:41:53

fabietto0102
Member
Registered: 2012-04-04
Posts: 26

Re: VIM with Python

Update: vim-nox does the trick of installing vim with python support. Now I have +python. Still not sure what does it mean though, having a +python...

Now I'll try to install some plugins and see how it goes... thanks njonaitis for your feedback

Offline

#5 2013-01-06 01:44:23

fabietto0102
Member
Registered: 2012-04-04
Posts: 26

Re: VIM with Python

Ok, as far as I understand installing plugins is as easy as download the plugin_name.vim and put it into a ~/.vim/autostart/ folder..

I have tested the omni-complete plugin and, while it shows a menu, it doesn't return the methods related just to the object I'm calling. Rather, it returns everything in my module. Will investigate a bit further.. If anyone has any suggestion, please share!

Offline

#6 2013-01-08 16:56:08

fabietto0102
Member
Registered: 2012-04-04
Posts: 26

Re: VIM with Python

ok, reading somewhere in internet, there's a bug with omni-complete and vim 7.2, which I was running on a ubuntu machine.. following the instruction here i got 7.3 and all seems to work as expected with very good results.
Now, I 'just' need to get used to vim and its 1001 shortcuts...

Will give it a week to test then will close this topic and write a simple howto

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo