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

PhpUser InterfaceEditorPhpstorm

Php Problem Overview


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

collapsed methods

Php Solutions


Solution 1 - Php

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

Solution 2 - Php

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

enter image description here

Solution 3 - Php

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.

Solution 4 - Php

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 )

Solution 5 - Php

for windows PhpStorm 2021.1

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionDmitry K.View Question on Stackoverflow
Solution 1 - PhpAndrewView Answer on Stackoverflow
Solution 2 - PhpDmitry K.View Answer on Stackoverflow
Solution 3 - PhpColinView Answer on Stackoverflow
Solution 4 - Phpsh6210View Answer on Stackoverflow
Solution 5 - Phpzeyad khadeedaView Answer on Stackoverflow