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_USERSoftwareMicrosoftVisualStudio10.0Text Editor
VS 2012: HKEY_CURRENT_USERSoftwareMicrosoftVisualStudio11.0Text 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.
- 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_USERSoftwareMicrosoftVisualStudio9.0Text 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_USERSoftwareMicrosoftVisualStudio7.1Text Editor
2005: HKEY_CURRENT_USERSoftwareMicrosoftVisualStudio8.0Text Editor
2008: HKEY_CURRENT_USERSoftwareMicrosoftVisualStudio9.0Text Editor
2008 Express: HKEY_CURRENT_USERSoftwareMicrosoftVCExpress9.0Text Editor
This also works in SQL Server 2005 and probably other versions.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…