Vertical Guidelines in Visual Studio

From time to time, I've found myself wishing that Visual Studio had vertical guidelines in the code editor. This may not apply to all developers, but in some scenarios, I'd really like to have a visual right border when writing code. In my case, it's typically when I'm writing sample code for publication, where code must only be, say, 70 characters wide, but I could also imagine that it would be beneficial for some development teams. Let's say that you have a development team with a wide variety of monitors. Some developers may work on very large monitors, whereas others may work on laptops (like me). In this case, an internal coding standard may dictate that code isn't wider than so and so many columns so that the developers with small monitors will not have to do a lot of vertical scrolling.

If you have a large monitor, you need some clue to where the right border is. Sure, you can get into the habit of looking at the column information in the status bar, but a vertical guideline would be more productive. As it turns out, Visual Studio has (and has had for some time) this hidden feature! Sara Ford explains how to set it up.

Personally, I find the red color in Sara's example too intrusive, so I'm using a rather ligth grey (200, 200, 200) that looks less intrusive on my laptop monitor.

Comments (3)

  1. Raj says:

    ..or you could use the free slickedit gadgets.

    (scroll down for screen caps)

  2. ploeh says:

    Nice. Thanks for sharing!

  3. John says:

    Is it possible for language specific settings as it only works for me from the root Text Editor node, not for example just CSharp which means I end up with guides in my output / immediate / command window etc etc

Skip to main content