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-F开发者_Go百科onts and Colors-Display Items-URL Hyperlink). I don't want the URLs to display any specific color, but instead use the surrounding context color.
Yes: disable
Tools\Options\Text Editor\your language here\Enable single click URL navigation
to turn off the 'helpful' feature.
For those of you that googled into here trying to disable this on the express version of VS2010:
You won't find the option to remove this 'feature' under tools, and unfortunately you cannot install that VSIX from Noah Richards.
What you can do, though, is change the option directly in the registry:
HKEY_CURRENT_USER\Software\Microsoft\VCSExpress\10.0\Text Editor\CSharp
there, change the value of "Make URLs Hot" to "0" and you're done.
(This is for c#. For c++ or others, I guess the path would be a bit different, but along the same lines).
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.
精彩评论