Nothing irritates me more than when my source code line-wraps when I output to a printer. A few years back, I did some J2EE work using the Eclipse IDE which sported a subtle pinkish-purple line down the right side of the page which deliniated the printing margin for the source code. Suddenly, I was able to format my code to avoid line-wraps.
For a long time after my Eclipse days, I worked in Visual Studio dissapointed with my formatting and wondering if Microsoft would every add that small little feature to the IDE. Then one day, I discoverd that Visual Studio does, in fact, have this feature: it’s simply hidden. As it turns out, you can pick the color and placement of the guidelines and how many.
Now I use guildeines on the left side of my source code to help me follow code blocks that are indented with four and five tabs. It is a lot easier to find the closing bracket to a while statement that runs more than a screen than it is without the guidelines.
So, to add guidelines to your Visual Studio source code, you need to first fire up the registry editor (Yes, this is a registry hack). Next:
– Open HKEY_CURRENT_USERS/Software/Microsoft/VisualStudio/8.0/Text Editor.
– Add a new String key
– Enter Guides for the name of the key
– Enter a value that contains the RGB value for the line color and a comma separated list of line locations.
For example:
RGB(255,127,237) 4, 16, 80
will put a pinkish-purple line at the 4, 16, and 80 character locations on your source code view.
Good luck, hopes this little trick helps.
Note: 80 characters is the traditional right margin for code print-outs.