Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the equivalent for eclipse's ALT+UP/DOWN (move line) in Visual Studio?

People also ask

How do you move a line up and down in Visual Studio?

If you put the cursor on a line of code and use the Alt+Up Arrow keys, the line of code you've selected moves up. If you use the Alt+Down Arrow keys, the line of code selected moves down.


In Visual Studio 2013 and later, this functionality is built in. ALT + UP/DOWN will move a line up or down.

If you need this functionality in VS2012 (works with VS2010 too), take a look at the MoveLine Visual Studio Extension or the Productivity Power Tools suite.


ReSharper's Ctrl + Shift + Alt + /// is even more powerful - when on the beginning of the line, it will move the entire line, but can also be used to move entire methods, change the order of parameters, etc.


For me in Visual Studio 2019 it comes default closed.

For open it:

Tools -> Options -> Keyboard then select Edit.MoveSelectedLinesUp, click "Press shortcut keys" input and press Alt + Up (or whatever you want for it). And the other one is Edit.MoveSelectedLinesDown, click "Press shortcut keys" input and press Alt + Down (or whatever you want for it).


This is now working out of the box with Visual Studio 2013, same way as in Eclipse.