Wimm Warehouse for PHP

Vim provides nice syntax folding for Ruby and C (well, that’s what I tried) out of the box, but what about PHP? It does not have this feature! Did I miss something?

+6
vim php folding
source share
2 answers

Folding should work in almost any language that uses parsers or brackets, so it should work in PHP. I added a few lines as key shortcuts in my .vimrc so that I can automatically add and expand all the definitions of my functions in the file quickly by entering a comma f or F:

" Folding and unfolding map ,f :set foldmethod=indent<cr>zM<cr> map ,F :set foldmethod=manual<cr>zR<cr> 

From there, you can expand or redo the levels using z and any fold command that you like. Good tutorial here .

+8
source share

there is a plugin that should solve your problem

http://www.vim.org/scripts/script.php?script_id=1623

+3
source share

All Articles