views:

173

answers:

2

Visual Studio 2010 "helpfully" detects URLs and colors them blue (by default). It will do this regardless of context - whether the URL is in the midst of XML, or it's in a comment, or it's a string in code, etc. I find this distracting. The URLs are part of their context. I'm not coding in Visual Studio in order to click on hyperlinks.

Is there any way to have Visual Studio treat URL hyperlinks the same as surrounding text? I know you can change the color from blue to something else (Tools-Options-Fonts and Colors-Display Items-URL Hyperlink). I don't want the URLs to display any specific color, but instead use the surrounding context color.

+6  A: 

Yes: disable

Tools\Options\Text Editor\your language here\Enable single click URL navigation

to turn off the 'helpful' feature.

Brian
Yes, that worked! I was able to globally disable it in the All Languages option in Text Editor. Thanks a ton.
Bryan B
A: 

You can't do it from a setting in the product, but I just wrote an extension that does it for you (called "ClearHyperlinkForeground"). You can download the VSIX here. You can also view the source on github, if you are curious how it works or want to build it for yourself. It's essentially a copy of my ItalicComments extension, just modified to clear the foreground brush of the URL formatting instead of italicizing comments.

Noah Richards
Cool! I used Brian's suggestion to turn off URL navigation, but this sounds like a great way to do customizations.
Bryan B