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:
The full method is
CVarDumper::dumpAsString
And I want it to complete if I type this:
CVarDumper::d<tab>
The double-colon does not work. However, if I replace the ::
with a .
then it does autocomplete:
CVarDumper.d<tab>
I see the c++ omnifunc function has an option to allow for ::
completion:
let OmniCpp_MayCompleteScope = 1 " autocomplete after ::
Is there an equivalent for the ft-php-omni
function, or a way to hack this feature in?
Update:
Turns out the problem was the supertab plugin, specifically this option in my .vimrc
" SuperTab option for context aware completion
let g:SuperTabDefaultCompletionType = "context"
After removing that option supertab + phpcomplete allows for completion of php class methods.
Try this alternative phpcomplete
script. It is better than the default one in every possible ways, including the fact that it supports static completion.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With