Visual Studio (2005,2008,2010) Tips and Tricks.
#35 Details on Outlining in Visual Studio
Tuesday, February 10 2009
Onlining,Onlining,Onlining. You know the little [+] in the left margin of your code in Visual Studio? That is called outlining, and if you click the [+] your code region will expand, and the icon changes to a [-]. Pretty straight forward. But did you know you can do all of this from the keyboard, without using the mouse? Check out video trick number #35 to see how it all works.
Snippets / Notes:
[CTRL][M]+[CTRL][M] Toggle Expand|Collapse region section
[CTRL][M]+[CTRL][L] Toggle Expand|Collapse document
[CTRL][M]+[CTRL][P] Turn off outlining
[CTRL][M]+[CTRL][O] Toggle Expand|Collapse to definition
Visual Studio Tip / Trick #035 English Transcription:
Today’s Visual Studio trick of the day Trick no. 35 was originally posted by Sara Ford’s September 2007. Today’s trick deals with outlining. On the Edit menu, under outlining there are number of options that you have. Toggle outlining, Toggle all outlining, Stop Outlining and then collapse to definition which I will give you some quick examples of.
So if you look at this collapsed method you will see that instead of just clicking with the mouse, you can do [CTRL]+[M],[M] to toggle collapsing. So [CTRL]+[M],[M] just collapsed it, then [M] again will expand it. You can also do [CTRL]+[M],[L] which will expand or collapse the entire document and then off course [CTRL]+[M],[L] again will toggle that back out. Now here is an interesting one that I didn’t know [CTRL]+[M],[P] will actually turn off the collapsible code all together and you think that [CTRL]+[M],[P] turns it back on again but in fact that’s not the case. If you are toggling outline is turned off then there is a new menu item there called start automatic outlining, which does not have a key board short cut. Its kind of wearied that you think these two toggle but start automatic outlining will turn that back on again. And lets see there is an another one [CTRL]+[M]+[O] will collapse to definition. So now you can see, you are collapsing each type of your methods to a specific definition and also confirmed that all of those work in Visual studio 2005 as well. In fact lets just take a look at the edit menu. We'll do a [CTRL]+[M],[P] to turn these off and then edit outlining and start automatic outlining does not have a key board shortcut there as well. So it’s the same functional behavior in both 2005 and visual studio 2008.
0 comment(s)