Guidelines – a hidden feature for the 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 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 = #800000 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.
Comments
VSEditor's WebLog
said:
Uwe Keim
said:
Uwe Keim
said:
sara ford
said:
If you encounter an issue on any version, let me know.
-sara
Andreas Häber
said:
I've often thought that such a feature would be nice to have, happily some dev at the VS team thought about that too. I'll let you know when/if it crashes ;) (I'm using VS2003 btw.)
Black Fox
said:
Thanks a lot
Carl Daniel [VC++ MVP]
said:
Steven Cohn
said:
BillT
said:
Guides = RBG(128,0,0) 5, 80
should be RGB, I assume.
The Emission Locus
said:
The Emission Locus
said:
Alain
said:
[HKEY_CURRENT_USER]\Software\Microsoft\VisualStudio\7.1\Text Editor
Guides=#c0c0c0 80
Be care about the space between Text and Editor !
Regards
Jasper22
said:
No effect on my Visual Studio 2003
OdeToCode Link Blog
said:
Clinton Gallagher
said:
[HKEY_CURRENT_USER]\Software\Microsoft\VisualStudio\8.0\TextEditor
Edit > New > String Value: Guides
Edit > Modify > Value Data: #fefcfc 4
Results in no change for either VS2003 or VS2005.
Modified Value Data As: =#fefcfc 4 does not produce results either.
Ironically, just this morning before reading this blog item I sent a suggestion to MSDN Feedback Center asking for the addition of 'status' when backspacing to prevent the annoying backspace to previous line which happens when backspacing past the 0th column which I am too blind to see perceptively.
Guidelines would do I suppose but again, they do not function for me and I believe I have modified the registry correctly as shown above. Please advise.
csgallagher@REMOVETHISTEXTmetromilwaukee.com
Jože Marinček
said:
Change the colour.
ISlavoF.Save()
said:
Harry Bosch
said:
RichB
said:
Sara - What does the Guidelines spec say is the intended usage scenario?
Alain
said:
I will use this feature to prevent me when I write more than 100 char in one line.
My source will be more readable and printable.
sara ford
said:
#fffcfc shows a white guideline. If you go to Tools Options - Fonts and Colors - Text Editor, and change the Text background to black, you'll see the white guideline.
thanks!
-sara
zeddock
said:
Thanx,
zeddock
sara ford
said:
Mike Dunn
said:
sara ford
said:
Kenny
said:
This is a feature that I've always missed in Visual Studio. I was especially happy to see that it also works in VS 2003, although I agree that it would be nice to have it only in the source code windows and not in the output window.
sara ford
said:
I'm recording all these suggestions, comments and feedback for the next version.
Jed Blog
said:
baris's blog
said:
The Emission Locus
said:
Nate's Blog
said:
Tom Seddon
said:
This doesn't affect all fonts; only those that are flush with the left edge of their bounding box as far as I can tell. (I have a couple of bitmap fonts that are like this, having the spare column on the right- rather than the left-hand edge.)
Tom Seddon
said:
1. Obviously the feature works for me (VS.NET 2002);
2. I noticed the 'lines on top of text' because I was trying out having guidelines at each tab stop. It would be handy for future revisions of the editor to not necessarily draw text on guidelines but perhaps when programming in languages that have curly braces draw a vertical line to the corresponding matching curly brace when the cursor is on a curly brace. The editor "scite" does this, and it's dead handy.
Thomas Due
said:
Jan Schreuder on .Net
said:
Wintellog
said:
CraigBlog
said:
Digital Thoughts
said:
Via...
How Things (Should) Work
said:
BorisJ's Blog
said:
BorisJ's Blog
said:
Nate's Blog
said:
useful piece of information today. There is a hidden guidline feature
in Visual Studio 2003. This isn't all that important to most people
anymore since code is rarely edited on a 80 column display but it is a
nice
Opher
said:
Wouter van Vugt
said:
Wouter van Vugt
said:
Tanveer
said:
mrk
said:
Tobias
said:
[HKEY_CURRENT_USER]\Software\Microsoft\VisualStudio\8.0\Text Editor
but under
[HKEY_CURRENT_USER]\Software\Microsoft\VCExpress\8.0\Text Editor
Hopefully there will be a straightforward configuration option in later versions of VS rather than modifying the registry manually.
Chris Christodoulou
said:
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\VisualStudio\8.0\Text Editor]
"Guides"="#c8c8ff 2,#ffc8c8 4"
but VS only used the last color. It would be rather cool if multiple color guides were supported so when many guides are shown one wouldn't have to count them to find the right spot. Other than that, good stuff!
Cheers,
Chris
John Cui
said:
Marcin Celej
said:
Gorky
said:
Make sure you set the registry value for *HKEY_CURRENT_USER* not HKEY_LOCAL_MACHINE which is what I tried at first and couldn't get it to work. I typically head to local machine in the registry out of habit.
Eric Hammersley
said:
bill
said:
Troy Scheffel
said:
Someone asked why you'd want this feature. I use two lines, one set at column 77 which is where I start most line comments and one set at column 120 which indicates where no text should extend beyond (to prevent line wrapping during printing). Thus, my Guides value is "#ff0000 76, 119" (255 = dark red).
ttfn
Неорганизованные Заметки Ремесленника
said:
Mythran
said:
Giuseppe Turitto
said:
[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.
JDang
said:
JDang
武眉博
said:
Magerquark.de » Visual Studio 2005 .NET-Tipps
said:
Nihgwu
said:
Wouter van Vugt
said:
Arvind
said:
ploeh blog
said:
From time to time, I've found myself wishing that Visual Studio had vertical guidelines in the code editor.
浙公网安备 33010602011771号