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. @chraas You might want to use it for complex parts of the site and not use it for simple rendering pages. 2 days ago
  2. @chraas In theory more SOLID, but I'm not sure it's worth the price. 2 days ago
  3. @chraas Be warned that you're introducing one big chunk of complexity with EPiMVP :) 2 days ago
follow me

Latest comments

  1. Berra S wrote "Read your post at http://joelabrahamsson.com/entry/using-xfo..." on PageData objects not returned as typed when using Page Type Builder and FindPagesWithCriteria
  2. Linus wrote "1 up for behaviour being as close as expected as possible!" on A common problem with Page Type Builder and UniqueValuePerLanguage set to false
  3. Joel Abrahamsson wrote "Hi Hans, Could it be that you previously didn't have Page..." on Page Type Builder 2.0 released

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