views:

3313

answers:

7

Anyone know how to turn off code folding in visual studio 2008? Some of my colleagues love it, but I personally always want to see all the code, and never want code folded out of sight. I'd like a setting that means my copy of Visual Studio never folds #regionsor function bodies.

+5  A: 

Options / Text Editor / C# / Advanced / Enter outlining mode when files open

Marc
+2  A: 

It's not permanent, but the keystrokes Ctrl-M Ctrl-L expand the regions in a file

Lou Franco
+33  A: 
Greg
Unchecking this option disables outlining completely however. Is there another setting somewhere that will just display all regions in the code expanded when a file is opened?
0xA3
I think you have to use Macros to do that, but I don't know the code to accomplish it.
Greg
+2  A: 

Also, a quick way to toggle expand/collapse of all regions is: CTRL + M + L

jules
A: 

It would be really nice if it was possible to have it totally ignore (hide) regions... Ideas?

Ola
that's what the accepted answer does.
Steve Cooper
+6  A: 
Dusda
+1  A: 

I've posted an answer in a related-but-not-duplicate thread that may help some people here. I detailed how to create macros that will deactivate a single unit's #regions by commenting out the #region and #endregion directives, with a companion for reactivating them. With the #regions deactivated the Ctrl+M+O / Collapse to Definitions function does exactly what I want it to. I hope this is useful for someone beside myself.

http://stackoverflow.com/questions/225413/shortcut-to-collapse-to-definitions-except-regions/1805597#1805597

JMD