The Best of Visual Studio 2010: Pasting a single selection into a box selection

Tips Search

If you like the tips then you'll love the book!

Order your copy today:
http://www.amazon.com/gp/product/0735649928

The Best of Visual Studio 2010: Pasting a single selection into a box selection

  • Comments 4

Keyboard:  SHIFT + ALT + [ARROW]
Versions:  2010
Published:  1/13/2010
Code:  vstipEdit0008

 

In a previous tip, we looked at pasting one box selection into another.  In this tip we will see how to take a single selection and put it into a box selection.

Let's assume you have a setup like this:

clip_image002

 

But you realize that you need to change int to double.  No problem!

Select the double keyword and copy it (CTRL + C):

clip_image004

 

Then box select the destination (SHIFT + ALT + [ARROW]):

clip_image006

 

Finally, do a paste (CTRL + V) to see the result:

clip_image008

 

I've used this one a lot since I first heard of it and it totally rocks!

  • Sweet!  I've wanted this one for years!  VS2008 just deletes the selection and pastes the text once!  I don't know how I missed this the first time it was posted.

  • This is something I try and do every few years (not just in VS) in case it works and I didn't notice it being added. Fantastic to see it implemented.

    Tomorrow is VS2010 day for me. I wanted to install it today but had to finish off some work first (and now it's almost 3am so a bit late to mess around with my dev environment).

    From the tips here, plus reports of improved intellisense and F1 help (in C++) and a bunch of other stuff, I'm glad I'm able to update sooner rather than later. Wishing for features is one thing but knowing they're out now in a new version while being stuck on the old one would be annoying. :) I used to work in huge teams on massive projects where it could take years to convince everyone it was time to update VS. Not so at the moment, which is great.

    It's really all of these nice-to-have things, which might only shave off a few seconds here & there but add up to a much nicer environment, which are pushing me to switch to VS2010 now rather than wait.

    I'm also looking forward to the C++ language additions but it'll be a while before I get a chance to really start using those. (Have some code in mind that will benefit from them for sure, but it's not yet a priority.)

  • Cool! I like this tip the most! It helps me alot on modifying few lines of code at the same time especially when I am rushing project that near the timeline!

  • Leo, I'm getting us ready to move to VS2010 too, and I'm really psyched about the native multitargeting.  We're currently building both 2008 and 2005 and having to convert project files back to 2005.  With the multitargeting, we can move to MSBuild and build 2005 and 2008 with the same projects, and then move to 2010 once all our third-party components support it.

    I'm really liking MSBuild better than the .vcproj files.  I'm taking advantage of the ability to include common settings, and have reduced the size of my project files considerably.  I have some now that have absolutely no settings in them whatsoever, they're all common.

    When we do move, I'm going to have to point all the developers here so they can see all the new things such as this one.

    I've already used this tip several times in the last couple days.

Page 1 of 1 (4 items)
Leave a Comment
  • Please add 1 and 7 and type the answer here:
  • Post