Fold All (Ctrl+K Ctrl+0) folds all regions in the editor. Unfold All (Ctrl+K Ctrl+J) unfolds all regions in the editor. Fold Level X (Ctrl+K Ctrl+2 for level 2) folds all regions of level X, except the region at the current cursor position.
How to Collapse All Source Code in VS Code? To fold all top-level and child elements of your code: Enter command >fold and hit enter.
Not available in Visual Basic. (Ctrl+M, Ctrl+O) - Collapses the members of all types.
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
Take Look at Visual studio Code Keybindings section at this link.
Also Platform specific Key board shortcuts available in pdf.here is the links
Windows,MAC,Linux
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.
,
{
"key": "cmd+k cmd+s",
"command": "search.action.collapseSearchResults"
},
{
"key": "cmd+k cmd+e",
"command": "workbench.files.action.collapseExplorerFolders"
}
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
One simple way I use is:
Collapse Folders in Explorer
You can also define a custom shortcut for this command in settings.
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