Vim privedes nice syntax folding for ruby and c(well, that is what I've tried) out of the box, but what about php? It doesnt have this feature! Am I missing something?
It doesn't fold newly written lines for me so I have to reenable it mannualy every time I have finished writing portion of code.
John Doe
2009-11-28 17:05:02
+2
A:
Folding should work in just about any language that uses parens or brackets, so it should work in PHP. I've added the following few lines as key shortcuts in my .vimrc so that I can automatically fold and unfold all my function definitions in a file quickly by typing 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 unfold, or refold levels using z and whatever fold command you like. Good tutorial here.
mmrobins
2009-11-28 16:59:50