Life changing PHP plugins for Vim
A little compilation of usefull & must-known plugins & tips for any vimer playing with PHP.
This script can fold PHP functions and/or classes, properties with their PhpDoc, without manually adding marker style folds ({{{ and }}})
It Folds & unfolds one or all functions and/or classes this way :
class Foo {
+ 11 lines: function fooFunction($bar) **
+ 8 lines: function fooFunction2($bar) **
+ 24 lines: function fooFunction3($bar)
}
See http://www.vim.org/scripts/script.php?script_id=1623
PDV - phpDocumentor for Vim
This script provides functions to generate phpDocumentor conform documentation blocks for your PHP code. The script currently documents PHP 5 classes methods/functions attributes. Beside that it allows you to define default values for phpDocumentor tags like @version (I use $id$ here), @author, @license and so on :
/**
* Foo a bar
*
* @param string $bar
* @access protected
* @return void
*/
protected function Foo( $bar = "fooBar") {
//...
}
See http://www.vim.org/scripts/script.php?script_id=1355
Magic phpdoc multiline comment autoindent
This tip is perfectly illustrated on stackoverflow.com. The solution is :
Runtime syntax check for php
Check your php script to see if it had any syntax errors (similar to perl -c) :
If you also set 'autowrite' to true the file is automatically written when calling :make :
Here it is. Other PHP syntax check tips for vim are to be (re)discovered on vim's wikia