In Options, go to Languages / C# / Formatting Style / Line Breaks and Wrapping, find "Wrap long lines" below "Line Wrapping" group and enable it, then set "Right margin (columns)" to the desired value. That's pretty cool, but how can one see which lines will be wrapped?
Meet Visual Studio secret feature: Guides!
As described in this blog post, you can play a bit with registry and make Visual Studio display nice dotted vertical lines at specific column:
- Open "HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\Text Editor" key
- Create new string value "Guides"
- Set its value to something like "RGB(192,192,192) 119" (columns in registry are zero-based)
- Restart Visual Studio
Now you will be able to see when your lines are too long, and probably make manual formatting before ReSharper will split lines at next reformat.
10 comments:
Do you know if this works in VS2005 as well as Orcas?
For VS 2005 you should change registry path from "9.0" to "8.0". I didn't try it, but from the blogs I can say it should work.
I just tried VS2005, it works.
I donot have Test Editor under VisualStudio\9.0\ in registry ???
what should be done??
Pradeep, I don't know, sorry, do you look in Current User hive, not Local Machine?
hey thanks for the reply. I did look under Current User hive.
Let me google it, If I found a soln I shall post it here.
Pradeep, you should look for 'Text Editor' not 'Test Editor'.
I cannot believe that VS doesn't have some option setting for this silly regedit...
For VS2010, check out http://stackoverflow.com/questions/2660491/right-margin-marks-in-vs2010-text-editors
This no longer seems to work in 2012.
Post a Comment