Collapse all methods in Visual Studio Code

eadam picture eadam · Mar 8, 2017 · Viewed 262.9k times · Source

In Visual Studio Professional, we have a shortcut key, Ctrl + M Ctrl + O to collapse all methods and properties in a class. How can I do a similar thing in Visual Studio Code?

I know there are shortcut keys like Ctrl + Shift + [, but this does not meet the needs.

Is it possible to get the Visual Studio Professional-like behaviour in Visual Studio Code?

Answer

Pere Pages picture Pere Pages · Apr 30, 2017
  • Fold All:

    • Windows: Ctrl + K + 0
    • Mac: + K + 0
  • Unfold All:

    • Windows: Ctrl + K + J
    • Mac: + K + J

To see all available shortcuts in the editor:

  • Windows: Ctrl + K + S
  • Mac: + K + S

Screenshot of Visual Studio keyboard shortcuts

All shortcuts kept up to date by the Visual Studio Code team: Visual Studio Code Shortcuts