When I open a PHP file that contains a class, how can I have Vim automatically fold the document up like this?:

|
When I open a PHP file that contains a class, how can I have Vim automatically fold the document up like this?:
| ||||
|
feedback
|
|
Perhaps you want to set your 'foldmethod' option to "syntax"?
If this works as desired, you can put that command in Edit: I realized that you may want the class declaration not to be folded by default. To do so, try:
| |||
|
feedback
|
|
I think that this combination should work:
You might need to adjust the value of If you only want the functions themselves to be collapsed (and not any blocks within them), you may also want to adjust the value of If you are doing that to have a bird's view of your code you might be intereted by TagList or TagBar. | ||||
|
feedback
|