I'm using intelliJ
IDEA and by default, it displays a pair of folding toggles for methods and javadoc
comments, but not "if", "for" or "while" statements:
I wonder if there is a way to display toggles for all the code blocks surrounded by braces?
PS: too bad that I cannot upload an image. Hope you can understand what I'm talking about.
To fold or unfold a code fragment, press Ctrl+NumPad - / Ctrl+NumPad + . IntelliJ IDEA folds or unfolds the current code fragment, for example, a single method. To collapse or expand all code fragments, press Ctrl+Shift+NumPad - / Ctrl+Shift+NumPad + .
Open 'Settings' from the File menu. Under 'Editor' -> 'General' -> 'Code Folding', you will find a 'Collapse by Default' section. Simply uncheck 'One-line methods' and click OK.
You can fold any code block with Ctrl+Shift+. (also available in the Code → Folding menu).
Ctrl+. (same menu) folds a selection.
(Use ⌘ instead of Ctrl on OSX.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With