Saturday, March 31, 2007

They're more like guidelines...

Finally! An equivalent to SciTE's edge.* settings in Visual Studio! Trouble is, it's not called "edge" or "margin" (Eclipse), but "guidelines". No wonder I couldn't find anything on the topic when I was searching online!

Thanks go out to Sara Ford who blogged about this wonderful feature. If only I had known about this, oh, three years ago! :)

Here you go. Just copy/paste the following into a .reg file and import it. You can change the colour (currently a very pale green) and at which column you want it to show (currently at 80). You can even add more columns apparently, but that's getting a little silly.

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0\Text Editor]
"Guides"="RGB(192,220,192) 80"


Anonymous said...

Works great for VS.2003 as well, but the index is zero-based, so for an 80-column line, the guide needs to be set for 79.

Since we use stone-age, FORTRAN-style coding standards at work, your find makes it so much easier to know where that required end-of-line is!


Olivier Dagenais said...

Hmmmm.... Try pasting the following string, which is exactly 80 characters (or write your own), in Visual Studio. With this setting (i.e. 80), the guideline is to the right of the last zero, which is what I'm used to with other text editors that also have this feature.


Olivier Dagenais said...

For the record, this also works with Visual C# 2008 Express, you just need to tweak the registry key to [HKEY_CURRENT_USER\Software\Microsoft\VCSExpress\9.0\Text Editor]...