Ⅰ. 插件描述
An enhanced definition and declaration jumper written in pure PHP for vim-phpⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'yaoguais/phpctags-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'yaoguais/phpctags-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'yaoguais/phpctags-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/yaoguais/phpctags.vim
Ⅳ. 文档说明
# phpctags
An enhanced definition and declaration jumper written
in pure PHP for vim-php.
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:
git clone https://github.com/yaoguais/phpctags.vim.git ~/.vim/pack/plugins/start/phpctags.vim
git clone https://github.com/yaoguais/phpctags.vim.git ~/.vim/bundle/phpctags.vim
Plug 'yaoguais/phpctags.vim', { 'do': ':GoUpdateBinaries' }
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