Search code examples
phpvimctags

VIM functions, variables hints per project


What solutions are for vim to have better completion with hints?

For example I have class:

class Main {
function __construct()
{
    echo "Function loaded...<br>"
}

/* public testIt(int $num, string $var) {{{ */ 
/**
 * testIt
 * 
 * @param int $num 
 * @param string $var 
 * @access public
 * @return void
 */
public function testIt(int $num, string $var)
{
    echo $num . ". " . $var;
}
/* }}} */
}

And other file:

include("class.php);

$main = new Main();

$main->testIt(

And then I type $main->testIt( function hint should popup (something like in netbeans).

I know I can achieve it with ctags, but problem is I need only tags which exist in project. For example Im writting $main->tes and hint should popup with testIt() function hint only.

I know answer probably will be pretty obvious, but it's little bit confusing.

Thanks.


Solution

  • When I want project and context aware completion, I leverage the power of an IDE (Eclipse) through Vim (using eclim). You may find other IDE integrations out there, for example I know Netbeans has extensive Vim support.

    This lets me use Vim for what it's good at - editing - and use an IDE for what it's good at - understanding and manipulating my project.