Vim editor supports Autocomplete by default for the standard text files and enables autocomplete for programmatic files by explicit configuration.
jedi-vim is a VIM binding to the autocompletion library Jedi. Here are some pictures: Completion for almost anything (Ctrl+Space). Display of function/class bodies, docstrings. Documentation (Pydoc) support (with highlighting, Shift+k).
Using Vim as a Python IDEThe python-mode project is a Vim plugin with syntax highlighting, breakpoints, PEP8 linting, code completion and many other features you'd expect from an integrated development environment.
Try Jedi! There's a Vim plugin at https://github.com/davidhalter/jedi-vim.
It works just much better than anything else for Python in Vim. It even has support for renaming, goto, etc. The best part is probably that it really tries to understand your code (decorators, generators, etc. Just look at the feature list).
This can be a good option if you want python completion as well as other languages. https://github.com/Valloric/YouCompleteMe
The python completion is jedi based same as jedi-vim.
As pointed out by in the comments, this answers is outdated. youcompleteme
now supports python3 and jedi-vim
no longer breaks the undo history.
Original answer below.
AFAIK there are three options, each with its disadvantages:
Python 3 and undo history (gundo!) are a must for me, so options 1 and 2 are out.
I tried pydiction (didn't work for me) and the normal omnicompletion (too limited). I looked into Jedi as suggested but found it too complex to set up. I found python-mode, which in the end satisfied my needs. Thanks @klen.
I found a good choice to be coc.nvim with the python language server.
It takes a bit of effort to set up. I got frustrated with jedi-vim, because it would always freeze vim for a bit when completing. coc.nvim doesn't do it because it's asyncronous, meaning that . It also gives you linting for your code. It supports many other languages and is highly configurable.
The python language server uses jedi so you get the same completion as you would get from jedi.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With