Visual Studio (2005,2008,2010) Tips and Tricks.
#47 Swapping Anchor points (THIS IS COOL!) in Visual Studio
Tuesday, February 10 2009
Swapping anchor points. This one left me wondering for a few minutes, but afer I figured it out, it was very nice. Many times I've selected the wrong text by a line or character or two. Only to have to reselect the entire selection.
This video trick shows you how to expand your selction on the top of bottom - no matter which direction you selected up or down. It is one of my favorites so far.
Snippets / Notes:
[CTRL]+[K] + [CTRL]+A
Visual Studio Tip / Trick #047 English Transcription:
Today’s Visual Studio video Trick of the day trick #47 is video repost of Sara Fords original blog trick 47 back in Sep 2007. The trick is Swapping Anchor points so if you are selecting something as I move my cursor up you can see its now focus on line 8 and if I [Shift] select with my arrows now my cursor is down at line 14. You can also do selection with your mouse is very common for us and my cursor usually ends up at the last point you have selected so you do [CTRL]+[K],[A] your cursor will swap to the other end of that anchor point so my cursor moved from line 11 up to line 7. I was struggling to find out that how this was useful because if you have a selection it’s pretty much known at that point anything else you do will either replace the selection or lose the selection so if you just start typing so that will effectively wipes the selection but Josh on CloudDB.com team pointed out that if you are starting to select something from the middle of the text I am right in the middle of the word updated here and I started scrolling up and in fact I wanted to select more of that text but I cannot do a [CTRL]+[K],[A] which will move my cursor anchor point to the end now I can continue to add more to that selection so this now becomes a pretty cool useful trick to me, [CTRL]+[K],[A] goes to the top I can add to or subtract what I am trying to select, [CTRL]+[K],[A] goes to the other line and I can in fact move the end point so that a pretty cool trick [CTRL]+[K],[A] is confirmed to work in Visual Studio 2005 as well as 2008.
4 comment(s)
That's really cool! But on my Studio it's Ctr+E+A!?
E for Edit and A for Anchor. Pretty easy to remember. But why is it different from yours?
@Stranger,
Do you have any add-on's installed, or is your Visual Studio right out of the box?
Do you remember what profile you chose to get started, when you installed Studio?
And are you on 2005, or 2008?
It's the c# profile and the only plugoin I'm aware of ist AnkSvn. Oh, and it's VS 2008.
But it's not the first time I'm wondering why others are using different shortcuts. e.g. accessing the several tool windows always starts with Ctrl+W (for window, of course) on my VS. So Solution window ist Ctrl+W+S, Output Ctr+W+O etc. But often I see people use Ctrl+K+Letter). Even AnkSvn uses Ctrl+K+C for the Pending Changes window by default. Why K? What's the deal with that Ctrl+K guy?
Can confirm that both shortcuts work in my environtment :)