Folding code blocks in VS Code
- Planted:
When working in large code files, I like to collapse code that I’m not editing to visually focus on what I am editing, without noise.
In VS Code, the "Fold All" command (⌘R ⌘0
) collapses all functions, imports, comments, etc. I find "Fold Level 1" (⌘R ⌘1
) even more useful because it does not recursively fold. So once you open a region, you don’t have to feverishly unfold to see what you need.
There are many folding and unfolding commands to fold specific levels, fold recursively, fold certain types of code, and so on. Tidy coding.