Guidelines–a hidden feature for Visual Studio Editor

Update 12/2/2004:  Uploaded an image from Visual Studio 2005 Beta.  Note the image below shows guidelines at column numbers 5 and 30, but the regkey value is RBG(255,0,0), 4, 29.  The Guideline column numbers are 0-based in the registry.

Update 11/29/2004: I’ve corrected the two (embarrassing) typos below.  I must have had thanksgiving dinner on the brain at the time.  1.  The reg key is [HKEY_CURRENT_USER]\Software\Microsoft\VisualStudio\8.0\Text Editor (note the space between Text and Editor).  2. It’s RGB, not RBG.  The example had a typo, but it is now corrected.

Guidelines at columns 5 and 30

Guidelines are visible column indicators for the VS Editor. During the last test pass, I came across a test case named “Guidelines” which got my immediate attention. I never heard of this before, so I made sure to spend extra time testing this cool, but hidden little feature during the Beta test pass. I didn’t find any issues with it, so I feel it is safe to share. Let me know if you run into any issues with it.

Warning! To enable guidelines, you’ll need to modify your registry settings. Follow the instructions below at your own risk.

Enabling Guidelines

First, shut down Visual Studio 2005 if already started.

Under

[HKEY_CURRENT_USER]\Software\Microsoft\VisualStudio\8.0\Text Editor

Create a string value called “Guides”

Set Guides to the following

RGB(x,y,z) n1,…,n13

Where x,y,z are the RGB values and n is the column number. You can have at most 13 guidelines.

For example,

Guides = RGB(128,0,0) 5, 80

will place a Red guideline at column numbers 5 and 80.

And now launch VS and open a text file.

Disabling Guidelines

An obvious no-brainer, just delete the Guides keys you created above. Restart VS, and no more guidelines.

View original comments

One thought on “Guidelines–a hidden feature for Visual Studio Editor

  1. How to get the same effect for SQL Server Management Studio:

    This is copied from the original comments but it was buried so deep I thought it could do with being brought to the surface again:

    [Giuseppe Turitto 8 Aug 2006 7:54 PM Thank You very much this is the most handy trick, Actually I tested for SQLmanager and works beautifull.

    [HKEY_CURRENT_USER]/Software/Microsoft/Microsoft SQL Server/90/Tools/Shell/Text Editor/

    and from there create the Guides String value, and everything its the same.]

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>