6

Is there a way to collapse all the functions in a given php file in TextMate?

For example I have two methods:

function index() {
    //Sample code   
}

function beforeFilter() {
    //Sample Code
}

I would like to be able to issue a command where all the methods will collapse to:

function index() { ...

function beforeFilter() { ...

Thanks!

tnichols
  • 635
  • 1
  • 8
  • 19

1 Answers1

16

Via the menu:

View > Toggle foldings at Level > All levels

enter image description here

or shortcut:

ALT + + 0

disco crazy
  • 31,313
  • 12
  • 80
  • 83
  • 1
    Only problem is that this also folds every if, else, etc. *inside* the functions as well... is there a way to only fold the top-level functions? – geerlingguy Sep 20 '11 at 16:51
  • 2
    Best way to do this is to collapse at all levels, then COMMAND + ALT + click the orange "collapsed" circle-arrow of the function you're looking at. This'll expand all levels, of just that one function, while all others will be collapsed still. – James Mar 04 '13 at 03:52