Cut, Copy, and Paste Collapsed Code with Outlining

Keyboard:  CTRL + M, CTRL + M (toggle outlining expansion)
Menu:  Edit -> Outlining -> Toggle Outlining Expansion
Command:  Edit.ToggleOutliningExpansion
Versions:  2008,2010
Published:  3/21/2010
Code:  vstipEdit0035


When working with Outlining, you can perform many timesaving operations.  One of those is the ability to take a long, funky chunk of code and work with it in a collapsed state.  Take, for example, this method that doesn't even fit on the entire screen:



When we collapse it using Outlining (click on the minus sign to the left of the signature) we get this:



Now we can cut, copy, and paste all of that code in one compact, ready to go, unit!  Try it yourself and see.

Comments (1)

  1. G says:

    Yay! And then after I cut the code, Visual Studio automatically reopens a neighboring collapsed item, causing me to completely lose my place, thus clawing back some of the time I would have saved.

Skip to main content