开发者

Visual Studio Minimize regions shortcut? [duplicate]

This question already has answers here: Command to collapse all sections of code? (22 answers) 开发者_C百科 Closed 8 years ago.

Is there a shortcut key in Visual Studio that will minimize all of the regions or + signs so that I don't have to go through and click each one individually?


C-m, C-o // collapse all
C-m, C-l // expand all
C-m, C-m // collapse, expand one

Where C is short for Ctrl. You can find more shortcuts at the msdn site

You can find the commands by going to Keyboard Options under the Tools menu, they are mapped to these commands

  • Edit.CollapseToDefinitions (C-m, C-o),
  • Edit.ToggleOutliningExpansion (C-m, C-m) and
  • Edit.ToggleAllOutlining (C-m, C-l)

Visual Studio Minimize regions shortcut? [duplicate]


If you are using Visual Studio Code the commands are similar but work differently. The commands are roughly these

  • C-k 2 - Fold Level 2
  • C-k C-j - Unfold all
  • C-k [ - Unfold recursively (unfold where the caret is)

You can search for Fold or Unfold commands (using C-S-p) to find all of them.


  • Ctrl + M,M - expand/collapse at caret
  • Ctrl + M,O - collapse all in document
  • Ctrl + M,L - expand all in document


Ctrl + M, Ctrl + M

You can perform this on a selection too.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜