Visual Studio Tip: Guide Lines for Line Wrapping

Nothing new here, but I was talking about it with a colleague today who wasn’t aware of the feature, so if you haven’t seen it before you might find this useful

Let’s say you want to wrap or break lines in your source code at the 80 column mark or 120 columns (or whatever your team prefers).  How do you do this?  Visual Studio doesn’t include any options in the GUI to enable such functionality.

That said, it is possible, and you may have seen people who have guidelines on their screen that look something like the following:

image

The way to do it is to simply jump into Regedit and add a value as follows:

Key: HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\Text Editor

String Name: Guides

Value: RGB(128,0,0) 80,120

The 80,120 will actually add two guidelines – one at column 80 and one at column 120.

Hope that helps!

References: Stack Overflow and Sara Ford

 

Reader Comments

Post a Comment



Welcome

As you might have guessed, this is a tech blog. I normally write about development and things that can help us do it better, specifically in the .NET space, and occasionally i'll throw in a post about whatever happens to be in my head at the time. Enjoy your visit!
And in case you were wondering, I'm a Principal Consultant for Readify, I run the Sydney Alt.Net group and I play a bit of LOTRO in my spare time (feel free to look me up)


 

My Open Source Projects

Labels

Blog Archive