Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Minimize regions shortcut? [duplicate]

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?

like image 702
PICyourBrain Avatar asked Nov 12 '10 13:11

PICyourBrain


People also ask

How do I minimize all regions in Visual Studio?

(Ctrl+M, Ctrl+P) - Removes all outlining information for the entire document. (Ctrl+M, Ctrl+U) - Removes the outlining information for the currently selected user-defined region. Not available in Visual Basic. (Ctrl+M, Ctrl+O) - Collapses the members of all types.

What is Ctrl Shift F in Visual Studio?

Ctrl-Shift-F is used to find all the ocuurance of a string with in entire solution and display find result window as shown below. Ctrl-F is used to find a string in the current document, project and all open documents one by one.

How do you collapse all regions in Visual Studio code?

Use Shift + Click on the folding icon to fold or unfold the region and all regions inside. You can also use the following actions: Fold (Ctrl+Shift+[) folds the innermost uncollapsed region at the cursor.


2 Answers

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)

enter image description here


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.

like image 68
Patrick Avatar answered Oct 23 '22 11:10

Patrick


  • Ctrl + M,M - expand/collapse at caret
  • Ctrl + M,O - collapse all in document
  • Ctrl + M,L - expand all in document
like image 25
Drew Noakes Avatar answered Oct 23 '22 12:10

Drew Noakes