3

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?

ib.
  • 27,830
  • 11
  • 80
  • 100
Marin
  • 1,311
  • 16
  • 35

1 Answers1

3

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

Michael Berkowski
  • 267,341
  • 46
  • 444
  • 390
  • Sorry, I didn't copy all lines, I've got that, and the example you attached works. But it doesn't work for ie. "pri" (print" – Marin Sep 01 '11 at 14:07
  • 1
    @Marin mine doesn't complete `print` either, but completes all the harder to remember stuff. Not sure why it doesn't do basic language constructs, but it does function and module completion – Michael Berkowski Sep 01 '11 at 14:11