yaoguais/phpctags

An enhanced definition and declaration jumper written in pure PHP for vim-php.


Keywords
ctags, vim, definition, declaration, php-vim, vim-plugins
License
Apache-2.0

Documentation

phpctags

An enhanced definition and declaration jumper written in pure PHP for vim-php.

Build Status codecov

When we work on a huge project, which would has hundreds of the same tags, and it is hard to choose the correct tag.

And I wrote the jumper that named "phpctags", but which doesn't generate tags file. It replace the shortcut key "<C-]>" with executing an external php script, which returns the jump position for the definition or declaration of the keyword that you hit.

Usage

$ bin/PHPJumpToDefinition --help

  -f, --file=FILE              file that needs to be parsed
  -l, --line=LINE              line number where the keyword appear
  -c, --column=COLUMN          column where the keyword appear
  -k, --keyword=KEYWORD        keyword that needs to be analysed
  -r, --root=ROOT              project root for finding functions and others
  -a, --autoload=AUTOLOAD      user project autoload files, default 'vendor/autoload.php'
  -h, --help                   print the help info and exit
  -v, --version                print the version and exit

returns '$jump_file $jump_line $jump_position' when success, 
and returns a string start with 'Error' then following detail 
information when failed.

Install

Install for popular vim package managers:

  • Vim 8 packages
    • git clone https://github.com/yaoguais/phpctags.vim.git ~/.vim/pack/plugins/start/phpctags.vim
  • Pathogen
    • git clone https://github.com/yaoguais/phpctags.vim.git ~/.vim/bundle/phpctags.vim
  • vim-plug
    • Plug 'yaoguais/phpctags.vim', { 'do': ':GoUpdateBinaries' }
  • Vundle
    • Plugin 'yaoguais/phpctags.vim'

Install the_silver_searcher for quick searching:

$ brew install the_silver_searcher
  or
$ apt-get install silversearcher-ag

Finally add the bin dir into the system $PATH variable:

$ git clone https://github.com/yaoguais/phpctags.vim.git
$ cd phpctags.vim && composer install --no-dev
$ export PATH=$(pwd)/bin:$PATH

Road Map

Road Map

Enjoy it