You are not logged in.
I can't manage to get omnicompletion to work with python 3 in vim, I have put this in /usr/share/vim/vim73/autoload/python3complete.vim and set "autocmd FileType python setlocal omnifunc=python3complete#Complete" in my ~/.vimrc. When I do C-x C-o omnicompleteion only suggests local variables and '__builtins__()'. I have vim compiled with python3 support only.
Any suggestions?
Offline
Hi! Well, in first place i recomend you put this question in the section programing for a better answer. In second, I'm not experienced but looking at my .vimrc, when i configure it, i put "autocmd Filetype py set omonifunc=python3complete#Complete" not what you have. The next that i can tell you is that you can prove to run vim and then try to to do ":set omnifunc=python3complete#Complete" and look what you get.
I don't have more experience, but in any case, if you found the solution, please post it (May is useful for someone, like me)
Sorry for my poor english.
Offline
Vim is compiled without python 3 support. You can check with 'vim --version' at the command line or by using the command, ':version', from within vim. Please also read the help topic from within vim, ':he python3'. There are conflicts between python2 and python3 support in vim and the Arch developer had to make a choice.
Your options are either to forget about python3 support or to recompile vim. You might use the PKGBUILD offered with this post, https://bbs.archlinux.org/viewtopic.php … 2#p1044522, as a guide when modifying the current PKGBUILD from the ABS. You should read the cautions in the later posts in the thread before going ahead and recompiling. My choice has been to just live with it as it is.
Offline
I can't manage to get omnicompletion to work with python 3 in vim, I have put this in /usr/share/vim/vim73/autoload/python3complete.vim and set "autocmd FileType python setlocal omnifunc=python3complete#Complete" in my ~/.vimrc. When I do C-x C-o omnicompleteion only suggests local variables and '__builtins__()'. I have vim compiled with python3 support only.
Any suggestions?
aaron's python3complete.vim in the offical vim release has some bug.
you can try this:
http://lilydjwg.is-programmer.com/user_ … mplete.vim
Offline
This thread is 2 years old, but in case anyone having the same problem googling and get here (like me), here is a quick (and perhaps dirty) way to enable completion of python builtin variables.
Here is the diff:
133c133,135
< try: exec(src,self.compldict)
---
> try:
> exec(src,self.compldict)
> self.compldict.update(self.compldict['__builtins__'])(here concern vim-runtime-7.4.335-4 from arch official repo)
patch this diff to /usr/share/vim/vim74/autoload/python3complete.vim or, simply change line 133 of the file to the 3 lines of codes bleow --- shown above.
The official python3complete.vim only search the top-level namespace of your python script (by exec() your script in a new dictionary), and the attributes of objects you are completing. But the builtin variables (such as print, int, OverflowError) are located in the builtin namespace, which is not searched. This snippest will merge the builtin namespace into the dictionary searched, so you can omnicomplete them by C-x C-o in vim. However, you still cannot complete python keywords (but is usually typing it out is quicker?)
I think this is not a bug, but supplying this feature of completing builtin name would be great!
Last edited by brian_on99 (2014-06-23 14:53:23)
lightdm/Openbox || switched from crunchbang
Offline