Skip to content

My personal folding expr, folds php class functions from their opening comment to their closing paren.

Notifications You must be signed in to change notification settings

xp-bar/vim-php-folding

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

Vim PHP Folding

Installation

Put folding.vim under your vim installation directory under a ftplugin/php/ directory.

For me, for example, that's under ~/.vim/ftplugin/php/folding.vim, or for nvim ~/.config/nvim/ftplugin/php/folding.vim.

Options

you can also add the following options to your .vimrc to configure the way your folds behave:

" 1 = true, 0 = false

" convert '@return ReturnType' to ': ReturnType' in function preview if there is no return type specified in the function declaration
let g:php_fold_return_comment_as_declaration=1

" convert function access (public, private, protected) to UPPERCASE in preview
let g:php_fold_uppercase_access_types=0

" if the return type can't be found from an @return tag or a return type declaration, show the return type as ': unknown type' 
let g:php_fold_show_unknown_types=1

" the maximum length for function comments (accross all lines) before being truncated with '...'
let g:php_fold_comment_length=60

" show a preview of the first line in the fold, otherwise show the number of hidden lines
let g:php_fold_show_fold_preview=0

Before Folding

before folding

After Folding

after folding

About

My personal folding expr, folds php class functions from their opening comment to their closing paren.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published