Reputation: 371
How can I show(unfold) the hidden(folded) code in IntelliJ IDEA, as shown in the picture below, just using keyboard without touching the mouse?
Upvotes: 25
Views: 9072
Reputation: 16760
folding
Folding
actionExpand
and Collapse
should be visible now (with keymaps)Upvotes: 0
Reputation: 12684
In IntelliJ IDEA you can use to following shortcuts to fold/unfold code blocks:
By the way, in Settings → Editor → General → Code Folding you can specify the default folding behavior for a various situations (e.g., imports, one-line methods, inner classes, @SuppressWarnings annotations, array literals, generic constructors and many others):
And even after that your folding/unfolding hotkeys listed above will work as well.
Upvotes: 33
Reputation: 12948
The only available option for your need (about import statements) is,
Move your pointer to (+) button on the left hand side of the statement so you can see the pointer changes to hand mark.
Then Ctrl + -
Find this for more info expanding/collapsing code. But this is more about blocks.
Upvotes: 3
Reputation: 9639
To be sure which shortcuts are available go to settings > Keymap
then go to
Main Menu > Code > Folding
Expand default on mac : cmd+ default on win : ctrl + numpad + Collapse default on mac : cmd- default on mac : cmd- default on win : ctrl + numpad -
Upvotes: 5