Problem with Vim omnicomplete and system Python

只愿长相守 提交于 2019-12-23 19:01:29

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/7271129/problem-with-vim-omnicomplete-and-system-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!