Reputation: 3842
Trying to find the equivalent to Ctrl + Shift + - in Intellij that collapses/expands all functions.
Upvotes: 325
Views: 325629
Reputation: 8285
Here it is.
Ctrl+Shift+[ Fold (collapse) region editor.fold
Ctrl+Shift+] Unfold (uncollapse) region editor.unfold
Ctrl+K Ctrl+[ Fold (collapse) all subregions editor.foldRecursively
Ctrl+K Ctrl+] Unfold (uncollapse) all subregions editor.unfoldRecursively
Ctrl+K Ctrl+0 Fold (collapse) all regions editor.foldAll
Ctrl+K Ctrl+J Unfold (uncollapse) all regions
Ctrl+K Ctrl+1 Fold Level 1 (2 for level 2, 3 for level 3 and so on)
Take Look at Visual studio Code Keybindings section at this link.
Also Platform specific Key board shortcuts available in pdf.here is the links
Upvotes: 587
Reputation: 37100
You can set custom values for that.
Open Keyboard Shortcuts
collapse
Collapse All
and Collapse Folders in Explorer
options and set the shortcuts like I didOr you can open keybindings.json
file and add this to the main array.
{
// other key bindings ...
{
"key": "cmd+k cmd+s",
"command": "search.action.collapseSearchResults"
},
{
"key": "cmd+k cmd+e",
"command": "workbench.files.action.collapseExplorerFolders"
}
}
Upvotes: 50
Reputation: 101
Folding functionality has was introduced and fully integrated starting from Visual Studio Code version 0.10.11. Below are the available keyboard shortcuts for folding:
Fold folds the innermost uncollapsed region at the cursor:
Unfold unfolds the collapsed region at the cursor:
Fold All folds all regions in the editor:
Unfold All unfolds all regions in the editor:
Upvotes: 5
Reputation: 71
Go to 'Keyboard Shortcuts' and type in search input: "fold all regions". You see fold/unfold (expand/collapse) commands and shortcuts. Use or change them.
Upvotes: 5
Reputation: 251
One simple way I use is:
Collapse Folders in Explorer
You can also define a custom shortcut for this command in settings.
Upvotes: 25
Reputation: 11053
Go to File --> Preferences --> Keyboard Shortcuts (or Ctrl+K Ctrl+S)
Search for the word fold all
The ones you need are:
Set your custom keyboard shortcut
Upvotes: 42