Home

Awesome

Abstract

This is a mirror of http://www.vim.org/scripts/script.php?script_id=1623

This script can fold PHP functions and/or classes, properties with their phpdoc without manually adding marker style folds ({{{ and }}}). It will generate the following folds when executed:

<?php
/**
 * This is Foo...
 * @author Foo
 */
class Foo 
{
+-- 11 lines: function foo($bar) ** -------------------------------------------------
+--  8 lines: function bar($bar) ** -------------------------------------------------
+-- 24 lines: function baz($bar) ----------------------------------------------------
}
?>

Based on e.g. functions declared like this:

<?php
/**
* This is fooFunction...
*
* @param mixed $bar
* @access public
* @return void
*/
function fooFunction($bar) 
{
    ...
}
?>

SCREENSHOT

You can view a screenshot here: http://blog.cppse.nl/phpfolding-vim

FEATURES

FUTURE

CONTRIBUTE / GITHUB

It's then easier for me to accept pull requests and upload new version(s) here, also I cannot put phpfolding.vim in the ftplugin/php directory through the vim.org interface.

COMPATIBILITY

This script is tested successfully with Vim version >= 6.3 on windows and linux (With 6.0 it works sometimes, I don't recommend using it in that version)