Introduction
I’ve always been searching for a way to make Visual Studio draw a line after a certain amount of characters.
Below is a guide to enable these so called guidelines for various versions of Visual Studio.
Visual Studio 2013 or later
Install Paul Harrington’s Editor Guidelines extension.
Visual Studio 2010 and 2012
- Install Paul Harrington’s Editor Guidelines extension for VS 2010 or VS 2012.
- Open the registry at:
VS 2010:HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\Text Editor
VS 2012:HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\Text Editor
and add a new string calledGuides
with the valueRGB(100,100,100), 80
. The
first part specifies the color, while the other one (80
) is the column the line will be displayed. - Or install the Guidelines UI extension (which is also a part of the Productivity Power Tools), which will add entries to the editor’s context menu for adding/removing the entries without needing to edit the registry directly. The current disadvantage of this method is that you can’t specify the column directly.
Visual Studio 2008 and Other Versions
If you are using Visual Studio 2008 open the registry at HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\Text Editor
and add a new string called Guides
with the value RGB(100,100,100), 80
. The first part specifies the color, while the other one (80
) is the column the line will be displayed. The vertical line will appear, when you restart Visual Studio.
This trick also works for various other version of Visual Studio, as long as you use the correct path:
2003: HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\7.1\Text Editor
2005: HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0\Text Editor
2008: HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\Text Editor
2008 Express: HKEY_CURRENT_USER\Software\Microsoft\VCExpress\9.0\Text Editor
This also works in SQL Server 2005 and probably other versions.