Visual Studio Expand/Collapse keyboard shortcuts

Matthew Layton picture Matthew Layton · Dec 27, 2012 · Viewed 150.3k times · Source

In Visual Studio, if I have a code file open, I can press CTRL + M or CTRL + M + O to collapse all code blocks, regions, namespaces, etc.

How to I do the opposite and expand everything?

I have Googled this, but cannot seem to find a shortcut that works!

Answer

Matthew Layton picture Matthew Layton · Dec 27, 2012

Collapse to definitions

CTRL + M, O

Expand all outlining

CTRL + M, X

Expand or collapse everything

CTRL + M, L

This also works with other languages like TypeScript and JavaScript