Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problem with Vim omnicomplete and system Python

I have Vim set up, with +python (:version says it's ok). My .vimrc contains

filetype plugin on
set ofu=syntaxcomplete#Complete
autocmd FileType python setlocal omnifunc=pythoncomplete#Complete

When some .py file is open, and I type i.e. pri and press Ctrl-X, Ctrl-O, it says no pattern was found? Am I missing something? Can I somehow rebuild Vim's Python keyword database?

like image 466
Marin Avatar asked Aug 27 '26 11:08

Marin


1 Answers

Rather than syntaxcomplete#Complete, use pythoncomplete#Complete:

# ~/.vim/ftplugin/python.vim
setlocal omnifunc=pythoncomplete#Complete

# Or by autocmd
autocmd FileType python setlocal omnifunc=pythoncomplete#Complete

Python completion

like image 176
Michael Berkowski Avatar answered Aug 30 '26 02:08

Michael Berkowski



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!