What is equivalent for eclipse ALT + UP / DOWN (translation string) in Visual Studio?

In Eclipse, selecting a line and pressing Alt + ↑ / ↓ will move the line up and down, which avoids copying and pasting. Is there an equivalent in Visual Studio?

+62
eclipse visual-studio ide keyboard-shortcuts
Dec 24 '10 at 2:00
source share
5 answers

In Visual Studio 2013 and 2015, this functionality is built-in. ALT + UP / DOWN moves the line up or down.

If you need this functionality in VS2012 (also works with VS2010), check out the MoveLine Visual Studio Extension or toolkit for better performance .

+92
Sep 26 '12 at 11:40
source share
β€” -

ReSharper Ctrl + Shift + Alt + ↑ / ↓ / ← / β†’ is even more powerful - when at the beginning of a line it moves the entire line, but can also be used to move whole methods, change the order of parameters, etc.

+50
Dec 24 '10 at 23:15
source share

Now it works with the box with Visual Studio 2013, just like in Eclipse.

+5
Oct 22 '14 at 9:46 a.m.
source share

With the VSCommands extension, you have this particular key combination. And, by the way, the Stack OVerflow notification bar :)

+1
Sep 16 2018-11-11T00:
source share

In Visual Studio 2013 and later, you can move lines up and down using Alt + & uarr; / Alt + & darr; . Unfortunately, this will not affect the indentation if you move between blocks, so far only ReSharper (and any other Jetbrains IDE, including Rider) can help you with this.

To move entire blocks of code around, you can move the cursor to its head and press Ctrl + m twice to collapse it, and then use the above command to move it.

Here is a neat link to all the default keyboard shortcuts in different versions of Visual Studio.

+1
Oct 24 '17 at 11:50
source share



All Articles