How can I customize the text editor or color tag parts of my code in Visual Studio?

569 Views Asked by At

How do I customize, extend the text editor, or color tag parts of my code?

  1. I would like Visual Studio to color code parts of my code. Can I use #region and give it a color?

  2. Is there any way to make the background between two parentheses have a different color? (I want each code "block" to have its own color.)

I've looked here for some insight, but they all are implemented based "on what you select". All I want is to have the text editor "render" the text in a different way based on some rules.

2

There are 2 best solutions below

0
On

I don't know of anything exactly like what you're asking for, but the VS10x Code Map extention might help: http://www.axtools.com/products-vs2010-extensions.php

It will give you a nice overview of the code on the side, and make navigation somewhat easier.

The download button on the right lets you download a trial version from the Visual Studio Gallery at msdn.microsoft.com. I think you can also find it directly from the extentions view in VS2010.

0
On

I haven't seen such feature, but there is something quite close to what you are looking for in ReSharper. A setting called "Highlight matching delimiters". Looks like this in use: Resharper matching delimiter highlighting

I wanted tell you this because 1) You might be interested in resharper and 2) resharper is able to do the highlighting so maybe someone can make an add-in or something to add this kind of feature. Maybe you? :)