Collapse and Uncollapse Sections of Code in Visual Studio Code – Shortcuts

Here is the list of shortcuts to fold or collapse sections of code in Visual Studio Code:

Collapse current section(where the cursor is active)::

Ctrl + Shift + [ on Windows and Linux
+ + [ on macOS
Unfold unfolds the collapsed region at the cursor:

Uncollapse current section(where the cursor is active):
Ctrl + Shift + ] on Windows and Linux
+ + ] on macOS

collapse code section vs code

Collapse All in the Editor:

Ctrl + K, Ctrl + 0 (zero) on Windows and Linux
+ K, +0 (zero) on macOS

Uncollapse All regions in the editor:

Ctrl + K, Ctrl + J on Windows and Linux
+ K, + J on macOS
collapse all vs code

You may also be interested to read our articles:

Buy Me A Coffee

Leave a Comment