Question

Im trying to get code completion for python in vim 7.3. When I install vim I use this configuration:

./configure --prefix=${HOME}/vim73 --enable-python3interp=yes --with-python3-config-dir=/home/etobkru/Python3/lib/python3.1/config 
make && make install

I copy this file: http://vim.cybermirror.org/runtime/autoload/python3complete.vim in to the ~/vim73/share/vim/vim73/autoload/ directory and in this file: ./share/vim/vim73/ftplugin/python.vim I change

setlocal omnifunc=pythoncomplete#Complete 

to

setlocal omnifunc=python3complete#Complete.

But when I press <c-x, c-o> I get an error message:

Error: Required vim compiled with +python3
E117: Unknown function: python3complete#Complete

and if I write :python3 I get

E319: Sorry, the command is not available in this version
Was it helpful?

Solution

It depends on your vim version and on how the OS provides Python and Python3, whether python and python3 are supported both. Else if compiled in at all, then the Python version you first use will be activated.

Check out the following thread and the one linked from there: Vim 7.3: Python3 support

OTHER TIPS

Delete any autocompletion attempts and forget about your problems, install neocomplcache (script site)

I had the exact same problem you had and this script solved all my autocompletion needs, its really feature rich and you won't notice its there until you need it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top