如何获得vim的omnicompletion使用支持PHP类方法::
使用vim + PHP + ctags的,我可以得到相当不错的PHP自动完成。但是,一部分真正躲开我:让VIM来自动完成类的方法。这里有一个例子:
Using vim + php + ctags I can get fairly good php auto-completion. But one part really eludes me: getting vim to auto-complete class methods. Here's an example:
完整的方法是
CVarDumper::dumpAsString
和我想它,如果我键入此完成:
And I want it to complete if I type this:
CVarDumper::d<tab>
的双冒号不起作用。但是,如果我替换:
与
然后它自动完成:
CVarDumper.d<tab>
我看到 C ++ omnifunc 函数有一个选项,允许为:
完成:
I see the c++ omnifunc function has an option to allow for ::
completion:
let OmniCpp_MayCompleteScope = 1 " autocomplete after ::
时有一个相当于为 FT-PHP-全
函数或方式破解这个功能?
Is there an equivalent for the ft-php-omni
function, or a way to hack this feature in?
更新:
原来,问题是 SUPERTAB插件,特别是这个选项在我的.vimrc
Turns out the problem was the supertab plugin, specifically this option in my .vimrc
" SuperTab option for context aware completion
let g:SuperTabDefaultCompletionType = "context"
移除选项 SUPERTAB +的 phpcomplete 允许的PHP类的方法完成。
After removing that option supertab + phpcomplete allows for completion of php class methods.
尝试这替代 phpcomplete
脚本。它比默认的在每一个可能的方式,包括它支持静态完成的事实越好。
Try this alternative phpcomplete
script. It is better than the default one in every possible ways, including the fact that it supports static completion.