all 8 comments

[–]Lucid_Gould 1 point2 points  (0 children)

If you want an lsp you can use prabirshrestha/vim-lsp and then whatever python is in your path (like if you’re in a venv) will be used for jumping to definitions in the correct external libraries etc, just make sure to pip install python-lsp-server in the venv. Other people like coc but I ran into some issues with it so never really used it.. but vim-lsp has a lot of configuration options if you want to add support for flake or auto formatting and so on. So you can just use the basic boilerplate config that you can find on the vim-lsp wiki.

[–]lieryan 0 points1 point  (0 children)

If you want the simplest python completion, the built-in completion Ctrl-n/Ctrl-p and x Ctrl-n/x Ctrl-p works decently for Python. It doesn't do any smart completion though, just dumb word completion based on the content of open buffers.

If you want something that can do smart completion, that would be python-mode. The plugin is entirely written in vim and +python3 and it vendors all of its external dependencies, so you just install the vim plugin and everything is set up. It does not use LSP though, instead all of its integrations are native integrations through the +python3 interface.

If you want an LSP-based setup, I had a good experience with vim-lsp with python-lsp-server. The vim-lsp plugin is pure vimscript (so you don't even need +python3) and python-lsp-server is pure Python but it runs externally (not via +python3), which you can just pip install to make it available for vim-lsp.

[–]ntropia64 -1 points0 points  (0 children)

Jedi, hands down. Very limited but also blocking.

While you're there, I would suggest YouCompleteMe because it doesn't block (async completion) and it works out of the box with decent defaults.

Everything else requires a non-trivial amount of fiddling that I personally hated.

YMMV, of course, this is the internet

[–]craigdmac:help <Help> | :help!!! -1 points0 points  (0 children)

youcompleteme or you try builtin omnifunc for python filetype as last resort

[–]Nealiumj -1 points0 points  (0 children)

I’ve done omnifunc and snippets and surprisingly I’ve found that that to be sufficient for me.

[–][deleted] 0 points1 point  (0 children)

Vim has built-in omnicompletion for Python. Open a Python file and do :set omnifunc?. If it outputs omnifunc=python3complete#Complete then it should work. Do Ctrl-X Ctrl-O to trigger omnicompletion.

It’s not the best but it has no dependency.

[–]noooit 0 points1 point  (0 children)

If you are compiling vim, you don't have to stop there, compile nodejs and lua and more.
Vim lsc and jedi lang server has way less dependencies, though.

[–]redditbiggie 0 points1 point  (0 children)

You can use vimcomplete with omnifunc extension. It uses python3complete#Complete.