I have been looking high and low for a way to auto collapse to definitions in visual studio 2012 when you open a file.
I found a solution for VS2010 here Any way to auto collapse to definitions whenever you close a document? but that requires a Macros which has been taken out in VS2012.
Any Solution would be much appreciated!
CTRL + M + O will collapse all. CTRL + M + P will expand all and disable outlining. CTRL + M + M will collapse/expand the current section.
Tip: You can jump to the definition with Ctrl+Click or open the definition to the side with Ctrl+Alt+Click.
Collapse All Regions command for #region blocks in C#, VB, C/C++, XAML (and possibly F#) source code files. The default key binding for this command is [Ctrl+M, Ctrl+R] Note: It may also work with F# files, when a #region block handler extension is installed.
If you are a keyboard user, place your text cursor somewhere inside the symbol name and press F12. If you are a mouse user, either select Go To Definition from the right-click menu or use the Ctrl-click functionality described in the following section.
Yes, macros are definitely gone from Visual Studio 2012.
Not exactly what you requested, but the Ctrl-M, Ctrl-O
keyboard shortcut is fast.
Third party tools like CodeRush! or Resharper may help here. I know that CodeRush is very customizable.
You can also create your own Visual Studio Extension. Extensions are more powerful than macros, but have a bit of a learning curve.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With