Question

I tried setting up omnicompletion in vim for a yii project. For this, I go yii/framework folder and create ctags file with ctags-exuberant -f yii.tags --languages=PHP -R Now in .vimrc, I added the yii.tags file with :set tags=~/public_html/yii/framework/yii.tags

On opening the tags file shows all classes.

However, when I open a file and hit C-x, C-o , the dropdown list contains only functions and variables. I couldn't find similar problem on the search. What could I be missing?

Was it helpful?

Solution

According to :help ft-php-omni, the default omnicomplete script for PHP (the one that is part of the standard vim distribution) only completes class names after the new keyword. Does that work?

If you want method completion to be restricted to the correct class, then you may have to add hints in the comments. The docs include the example

/* @var $myVar myClass */
$myVar->
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top