Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Show Indentation Lines in Visual Studio 2010

0.00/5 (No votes)
2 Dec 2011 2  
Wouldn’t it be great to have a visual aid to help you read your code and verify that is aligned properly and the tags match?

Have you found yourself wondering if your HTML tags have matching closing tags? Wouldn’t it be great to have a visual aid to help you read your code and verify that it is aligned properly and the tags match?

There is a great Visual Studio extension named Indent Guides which you can download from CodePlex, @ http://visualstudiogallery.msdn.microsoft.com/e792686d-542b-474a-8c55-630980e72c30. Once installed, restart Visual Studio and you can easily notice that your source code has now a visual line that you can use to ensure indentation is correct and to match tags. See the screenshot below:

Speaking of Visual Studio tips and tricks, here are another couple of tricks to improve the editor experience:

  • You can use Ctrl+E, D to format the selected text. This would add indentation to your code so it is easier to read, although you may want to use with caution because the indentation can be excessive for some people. You can find this option on the Edit -> Advanced menu.
  • A common question is how to display Line number on the Visual Studio 2010 editor. To do so, go to the Tools menu, click on Options -> Expand Text Editor, select a language, for example C# and click on General if is not selected automatically. Then, in the last section of the window named “Display”, enable the Line Numbers checkbox.
  • What if the code you are reading is all collapsed because somebody else used the Outline feature? Well, you can quickly turn off the Outline by pressing Ctrl+M, P, you can find all the Outline options on the Edit menu Outlining.

Hope this helps somebody out there.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here