Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to permanently disable region-folding in Visual Studio 2008

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.

like image 389
Steve Cooper Avatar asked Sep 22 '08 15:09

Steve Cooper


2 Answers

Edit: I recommend this other answer

Go to the Tools->Options menu. Go to Text Editor->C#->Advanced. Uncheck "Enter outlining mode when files open".

That will disable all outlining, including regions, for all c# code files.

like image 175
Greg Avatar answered Sep 28 '22 05:09

Greg


The accepted answer turns off ALL code folding. If you want to disable #region folding but collapse comments, loops, methods, etc I wrote a plugin that does this for you.

Make #regions suck less (for free):

http://visualstudiogallery.msdn.microsoft.com/0ca60d35-1e02-43b7-bf59-ac7deb9afbca

  • Auto Expand regions when a file is opened
  • Optionally prevent regions from being collapsed (but still be able to collapse other code)
  • Give the #region / #end region lines a smaller, lighter background so they are less noticeable (also an option)
  • Works in C# and VB (but only in VS 2010/2012, not supported for 2008)

Region Tool Screenshot

like image 38
NotDan Avatar answered Sep 28 '22 05:09

NotDan