Visual Studio 2013: Move Lines
Sat, Oct 26 2013 7:52
Want the benefits of drag and drop without moving your hands from the keyboard? The Visual Studio 2013 code editor now has the ability to move lines within your code using the keyboard.
The trick is the Alt key.
When your cursor is anywhere within the line to move, press Alt + up/down arrow to move the line up or down.
OK, this is rather difficult to demonstrate without a video. But what is a video but a set of individual frames?
You can also move a set of lines. Select any part of the lines to move (you don't have to select the entire line), hold down the Alt key and press the up or down arrow keys.
Use this technique any time you want to "drag and drop" lines of code without moving your hands from the keyboard.
For more information on the many new Visual Studio 2013 features, check out my new Pluralsight course: Mastering Visual Studio 2013.