可与轻度phpDocumentor plugin有效。
http://www.vim.org/scripts/script.php?script_id=2980“rel=“noreferer” 这里有经过修改的版,最近有所发展。
Edit Here s version 2 of the phpDocumentor plugin. It is more recent than the above two links.
Install the plugin into your $VIMFILES/plugin
directory and add this to your .vimrc:
" PHP documenter script bound to Control-P
autocmd FileType php inoremap <C-p> <ESC>:call PhpDocSingle()<CR>i
autocmd FileType php nnoremap <C-p> :call PhpDocSingle()<CR>
autocmd FileType php vnoremap <C-p> :call PhpDocRange()<CR>
以上规定,在插入、正常和直观模式中,“www.un.org/french/ga/president 将你的 cur放在一个类别、功能或可变的定义上,新闻Ctrlp,而原始材料将试图根据定义形成一个 do块。
Example function doc block:
/**
* testDocBlock
*
* @param mixed $param1
* @param mixed $param2
* @static
* @access public
* @return boolean
*/
public static function testDocBlock($param1, $param2) {
// Pressed Ctl-p while cursor was on the function definition line above...
}
Example class doc block
Copyright, version, author, etc are included by default in a class doc block. You can modify the plugin to include your own default values for these:
/**
* TestClass
*
* @package
* @version $id$
* @copyright
* @author Michael <me@exmaple.com>
* @license
*/
class TestClass {
}
Full abstract class example:
<?php
/**
* TestClass
*
* @abstract
* @package
* @version $id$
* @copyright
* @author Michael <email@example.com>
* @license
*/
abstract class TestClass {
/**
* publicProp
*
* @var string
* @access public
*/
public $publicProp;
/**
* privateProp
*
* @var string
* @access private
*/
private $privateProp;
/**
* testDocBlock
*
* @param string $param1
* @param string $param2
* @static
* @access public
* @return boolean
*/
public static function testDocBlock($param1, $param2) {
// code here...
}
}
?>