Shared Source – Right Margin Line
Good code style suggests limiting the length of a code line to 80 characters, and only 70 characters for indented code examples to be used in documentation. The Right Margin Line helps you to visually indicate the specified line length. It doesn’t prevent typing to the right of it, but lets you to identify and break long expressions over multiple lines.
On the other side, Visual Studio has built-in margin line support. You can enable it via the registry editor in the following entry at:
Where %VS_VERSION% is a version of the IDE you’re using, e.g. 10.0 (VS2010), 9.0 (VS2008), 8.0 (VS2005), 7.1 (VS2003).
The following string key should be added:
The first part specifies the color, while the other one (80) is the column the line will be displayed. This will produce a blue margin line right before the 80th column. It looks pretty well on white and black backgrounds, but you can of course change it easily to any color and position. Note: the registry entry is different for Express editions of Visual Studio.
However, the Right Margin Line shipping with CodeRush Pro has a few more options you can specify on the “Editor | Painting | Right Margin Line” options page in the Options Dialog. You can specify not only line color, its opacity and position, but also line style and line width:
The Right Margin Line feature is located inside an open source “CR_RightMarginLine” sample plug-in in the Shared Source solution of CodeRush. The feature is visual, so it is available on the DXCore Visualize toolbar:
—– Products: CodeRush Pro Versions: 9.1 and up VS IDEs: any Updated: Dec/07/2010 ID: C028