Box Selection In Visual Studio

May 28th, 2008 Adrian Banks 8439 Views

I was editing a large SQL script inside Visual Studio today and needed to insert several spaces into multiple lines to make the script more readable.

Turning something like this:

some text on line a
some text on line b
some text on line c
some text on line d

into:

some text      on line a
some text      on line b
some text      on line c
some text      on line d

I thought of doing it manually by hand, but as there were lots of lines to alter, I thought there must be a better way. I then remembered a feature of a word processor called ProText that I had many years ago on the Atari ST that had a feature called "Box Selection". This enabled you to select text across multiple lines without having to select the whole line (a bit like drawing a box with the mouse).

A quick search later and I found the instructions on how to do box selections in Visual Studio in an article on Sara Ford's blog.

Just hold down the Alt key whilst selecting text with the mouse and Visual Studio will switch from its normal "stream selection" mode into "box selection" mode. Once selected, you can indent the text using the tab key as normal and it will insert space to get the desired effect.

Entry Filed Under: Visual Studio


Subscribe to this feed Bookmark this post on del.icio.us Digg this post on digg.com Share this post

Leave a Comment

Required

Required, hidden

Please enter the following word: magic word

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

Subscribe to the comments via RSS Feed


Most Popular Posts



Calendar

July 2014
M T W T F S S
« Oct    
 123456
78910111213
14151617181920
21222324252627
28293031  

Most Recent Posts

Related Posts

RSS Feeds Feeds

Visitors

Visitor Map

Total Hits: 756178
Hits Today: 372