Dmitry K.
Dmitry K.

Reputation: 3198

How to make PHPStorm collapsing all methods/functions on file open?

How to make something like this? (all methods collapsed by default without any hotkeys)

collapsed methods

Upvotes: 122

Views: 59201

Answers (5)

zeyad khadeeda
zeyad khadeeda

Reputation: 91

for windows PhpStorm 2021.1

ctrl + expand method
ctrl - collapse method
ctrl+shift - collapse all method
ctrl+shift + expand all method

Upvotes: 9

Andrew
Andrew

Reputation: 20111

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

Upvotes: 191

sh6210
sh6210

Reputation: 4540

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 )

Upvotes: 32

Colin
Colin

Reputation: 2199

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.

Upvotes: 51

Dmitry K.
Dmitry K.

Reputation: 3198

Solution found (File -> Settings -> Editor -> General -> Code Folding

enter image description here

Upvotes: 80

Related Questions