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 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
You may also be interested to read our articles: