newbie
newbie

Reputation: 57

vs2012 shortcut keys for moving lines of code

what are shotcut keys in vs2012 ,which to copy a line of code then move down or up,and cut a line of code then move down or up??

the copy version:

printf("hello world");// press a shotcut key ,then ..
printf("hello world");// this line of code automaticly appear here.

the cut version:

printf("hello you");//press a shotcut key ,then this line **will be cut**,and then ..
printf("hello you");//this line of code automaticly appear here.

is there any shotcut key exists likes them?

Upvotes: 1

Views: 1748

Answers (3)

Orion Edwards
Orion Edwards

Reputation: 123642

The Visual Studio Productivity Power Tools extension adds support for this. It's the "Move Line Up/Down Commands" feature.

With this feature enabled Alt+ and Alt+ move the current line (or multi-line selection) up or down.

Usually the first thing I do when set up visual studio is install this extension, then turn off all the other rubbish it adds (weird document tabs, scrollbar etc) just for the move up and down

Upvotes: 1

Daniel Figueroa
Daniel Figueroa

Reputation: 10666

Shift-Alt-T moves the line with the cursor down one line, I'm still trying to figure out how to move it up.

So after a little bit of googling it doesn't seem that VS has a keyboard shortcut to move a line up, which is quite baffling since the do have the above mentioned shortcut to move a line down. Anyway, you're definitely not the only one who wants this functionality and there are a few suggestions to this.

Either install this extension (free): MoveLine extension

Or you could install ReSharper which is really, really nice in my opinion: ReSharper

Upvotes: 2

Rob
Rob

Reputation: 3574

You should try this explanation below: http://www.herrodius.com/blog/52

Upvotes: 1

Related Questions