Adding a guideline to the editor in Visual Studio

后端 未结 5 1605
误落风尘
误落风尘 2020-11-28 00:26

Introduction

I\'ve always been searching for a way to make Visual Studio draw a line after a certain amount of characters.

Below is a guide

相关标签:
5条回答
  • 2020-11-28 00:37

    There is now an extension for Visual Studio 2012 and 2013:

    http://visualstudiogallery.msdn.microsoft.com/da227a0b-0e31-4a11-8f6b-3a149cf2e459

    0 讨论(0)
  • 2020-11-28 00:45

    Without the need to edit any registry keys, the Productivity Power Tools extension (available for all versions of visual studio) provides guideline functionality.

    Once installed just right click while in the editor window and choose the add guide line option. Note that the guideline will always be placed on the column where your editing cursor is currently at, regardless of where you right click in the editor window.

    To turn off go to options and find Productivity Power Tools and in that section turn off Column Guides. A reboot will be necessary.

    0 讨论(0)
  • 2020-11-28 00:46

    If you are a user of the free Visual Studio Express edition the right key is in

    HKEY_CURRENT_USER\Software\Microsoft\VCExpress\9.0\Text Editor
    

    {note the VCExpress instead of VisualStudio) but it works! :)

    | improve this answer | |
    0 讨论(0)
  • 2020-11-28 00:50

    This is originally from Sara's blog.

    It also works with almost any version of Visual Studio, you just need to change the "8.0" in the registry key to the appropriate version number for your version of Visual Studio.

    The guide line shows up in the Output window too. (Visual Studio 2010 corrects this, and the line only shows up in the code editor window.)

    You can also have the guide in multiple columns by listing more than one number after the color specifier:

    RGB(230,230,230), 4, 80
    

    Puts a white line at column 4 and column 80. This should be the value of a string value Guides in "Text Editor" key (see bellow).

    Be sure to pick a line color that will be visisble on your background. This color won't show up on the default background color in VS. This is the value for a light grey: RGB(221, 221, 221).

    Here are the registry keys that I know of:

    Visual Studio 2010: HKCU\Software\Microsoft\VisualStudio\10.0\Text Editor

    Visual Studio 2008: HKCU\Software\Microsoft\VisualStudio\9.0\Text Editor

    Visual Studio 2005: HKCU\Software\Microsoft\VisualStudio\8.0\Text Editor

    Visual Studio 2003: HKCU\Software\Microsoft\VisualStudio\7.1\Text Editor

    For those running Visual Studio 2010, you may want to install the following extensions rather than changing the registry yourself:

    • http://visualstudiogallery.msdn.microsoft.com/en-us/0fbf2878-e678-4577-9fdb-9030389b338c

    • http://visualstudiogallery.msdn.microsoft.com/en-us/7f2a6727-2993-4c1d-8f58-ae24df14ea91

    These are also part of the Productivity Power Tools, which includes many other very useful extensions.

    0 讨论(0)
  • 2020-11-28 00:58

    Visual Studio 2017 / 2019

    For anyone looking for an answer for a newer version of Visual Studio, install the Editor Guidelines plugin, then right-click in the editor and select this:

    0 讨论(0)
提交回复
热议问题