Back to all posts

Fold Code in VS Code to Read Big Files Easier

A quick VS Code tip for folding all the code in a file so you can see its structure, using only the keyboard.

Fold and Unfold With the Keyboard

I’m a blind developer, so when I open a large file I can’t just scan through it quickly. One thing that helps a lot in VS Code is folding the code so I can get a higher level view first.

To collapse everything, press Ctrl+K, then Ctrl+0. That folds all the classes, functions, and methods, so I can see the shape of the file before I dig into any one part.

To expand it all back out, press Ctrl+K, then Ctrl+J.

No mouse needed. Follow along for more VS Code tips.