Select columns of text in Visual Studio

Last week I learnt a really clever little trick in Visual Studio from Marthin Freij. While it’s a very old feature in Visual Studio it was news to me that you could select columns of text. That is, if you hold down SHIFT + ALT while dragging the mouse pointer over a block of text you wont select the entire rows of text that you have dragged the mouse pointer over but only the text in the area that you dragged over. That is, without holding down SHIFT + ALT you could end up with a selection like this:

NormalTextSelection

If you instead hold down SHIFT + ALT while dragging the mouse pointer your selection would instead look like this:

TextColumnsSelectedInVisualStudio

Know of another really cool and elegant but not so well known feature in Visual Studio? Please enlighten me in a comment!

PS. For updates about new posts, sites I find useful and the occasional rant you can follow me on Twitter. You are also most welcome to subscribe to the RSS-feed.

Comments

  1. Visual C# Kicks's avatar

    Visual C# Kicks 2 years ago

    That is very cool indeed. It's also been improved in Visual Studio 2010 so modifying the selection behaves more intuitively.

  2. Leif's avatar

    Leif 2 years ago

    There are so many...
    Sara Ford, one of the testers on VS2005/VS2008, used to have a Tip of the day on her blog, e.g. "box selection". :-) http://blogs.msdn.com/saraford/archive/2007/07/27/did-you-know-how-to-do-box-selection-in-the-editor.aspx

    The "Tip of the day" just returned a few weeks ago for VS2010.
    http://blogs.msdn.com/saraford/archive/2010/01/11/visual-studio-2010-tip-of-the-day-returns.aspx

  3. TD's avatar

    TD 2 years ago

    It works with the ALT key only.

Follow me on Twitter

  1. @unclebobmartin Because code coverage is a number that management can measure? 13 hours ago
  2. I'm amazed. "oikeinkirjoitusehdotuksista" is an actual word in the Finnish language! 14 hours ago
  3. @tednyberg Amen to that! 14 hours ago
follow me

Latest comments

  1. Per Ivansson wrote "We will definitely try to release as continiously as we poss..." on On selling 200OK and Truffler to EPiServer
  2. Joel Abrahamsson wrote "Thanks Andreas! Regarding your questions it's not really ..." on On selling 200OK and Truffler to EPiServer
  3. Andreas R wrote "Congrats on the sale. Hope ur rolling around in cash now ;) ..." on On selling 200OK and Truffler to EPiServer

About this site

This blog is built with EPiServer Community, EPiServer CMS, ASP.NET MVC and a bunch of other great products. The source code is available for download at the projects page, where you also can read more about this site and my other projects.

read more