How to make something like this? (all methods collapsed by default without any hotkeys)
5 Answers
This works for me: CTRL SHIFT numpad -
It also collapses the class... but then just manually re-open the class by clicking the + and the methods are folded.
And then you can re-open all methods with CTRL SHIFT numpad +
https://www.jetbrains.com/help/phpstorm/code-folding-commands.html
-
3Windows: ctrl + +/- will expand or collapse *individual* methods – Drakes Nov 01 '18 at 19:15
-
For me, using this way when I close and re-open file everything re-open. – LuizMoratelli Apr 24 '19 at 14:58
-
1For macOS: `shift` + `command` + `-` – Hunter Dec 28 '21 at 18:31

- 3,065
- 2
- 21
- 32
-
7Ok I think I see that you enabled the 'Method bodies' setting, but how did you use this setting to get the methods to all fold? A shortcut? menu button? – Andrew Feb 02 '17 at 18:28
-
-
2@Black did you look at this page - https://www.jetbrains.com/help/phpstorm/code-folding.html ? – Dmitry K. Jul 07 '17 at 15:48
-
@Andrew. just hit all the checkboxes you fit necessary, for me PHP function and method bodies were enough. – Rafael Nov 17 '17 at 14:08
-
1What is the checkbox for the comments above PHP functions (shown in green in the OP image)? The ones included in `/** */`. Where you sometimes declare what `@params`the function uses and what it `@returns`. Thanks! – nclsvh Jun 06 '18 at 07:50
-
You don't need to change anything in the settings like Dmitry suggested.
Simply do ⌥⌘⌨ *1 -- That's OPTION+CMD+NumPad *, then 1.
If you're on Windows, it's CTRL+SHIFT+NumPad *, then 1.

- 2,109
- 1
- 20
- 22
I'm using ubuntu,
the command is
-> CTL, SHIFT and MINUS ( this will collapse the whole class including all methods )
-> CTL, PLUS ( will expand the class but all methods should be collapsed )
-> CTL, SHIFT and PLUS ( will expand the whole class including all methods )

- 4,190
- 1
- 37
- 27
for windows PhpStorm 2021.1
ctrl + expand method
ctrl - collapse method
ctrl+shift - collapse all method
ctrl+shift + expand all method

- 71
- 1
- 1