Ⅰ. 插件描述
Yii2 apidoc as Vim helpfilesⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'mikehaertl/yii2-apidoc-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'mikehaertl/yii2-apidoc-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'mikehaertl/yii2-apidoc-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/mikehaertl/yii2-apidoc-vim
Ⅳ. 文档说明
Yii 2 API docs for Vim
Installation
Add mikehaertl/yii2-apidoc-vim to your Vundle configuration.
Alternatively you can download the files from here,
extract the package and move the docs/ directory to your ~/.vim directory.
If the help is not available after installation, you can try to issue this command in VIM:
:helptags ~/.vimrc/docHow to use
There is no configuration required for this plugin.
:help yii/web/ControllerYou should note though, that we use a forward slash (/) instead of a backslash (\) as
namespace separator. This was neccessary because when searching for tags, Vim uses regular
- So any backslash would indicate the start of a search pattern and you would
- to type e.g.
yii\\base\\Controller. Autocomplete wouldn't work very well either.
How to create the doc files
Note: This is only required if want to build your own flavour of the help files.
Start in an empty directory and install the yii2-apidoc-vim package via composer:
composer require mikehaertl\yii2-apidoc-vim dev-master
Now you can run the apidocvim command to extract the docs in Vim format from any
source files:
./apidocvim api path/to/some/source/code /path/to/output/dirYou can also use the update-all command to automatically extract the doc files from
the currenty yii2 packages installed in vendor/.
How to customize the created doc files
You can modify the view files in src/templates/views and adjust the render methods insrc/templates/ApiRenderer.php.