Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to move line up and down in VS2015

I don't know if something has changed recently in Visual Studio 2015 but before I was able to press ALT + UP ARROW KEY or ALT + DOWN ARROW KEY to move lines in code up or down and now it does not do anything.

I went into Tools > Options > Environment > Keyboard and I cannot find anything like in the past called ProjectandSolutionContextMenus.Item.MoveUp or ProjectandSolutionContextMenus.Item.MoveDown

Also here in the list of VS2015 I don't see that option: http://visualstudioshortcuts.com/2015/

How to achieve this?

like image 666
diegosasw Avatar asked Oct 13 '16 03:10

diegosasw


People also ask

How do you move a line up or down in code?

Alt + ↑ (Up Arrow) – Moves a line up. Alt + ↓ (Down Arrow) – Moves a line down.

How do I move a line up and down in eclipse?

Moving lines: You can move lines up and down by pressing ALT+UP or ALT+DOWN. No need to select, cut, or paste! Duplicating lines by pressing CTRL+ALT+UP.

How do I move a line up and down in Intellij?

With your caret on a line, you can press ⌥⇧↑ (macOS), or Alt+Shift+Up Arrow (Windows/Linux), to move a line up. Alternatively, you can move a line down with ⌥⇧↓ (macOS), or Alt+Shift+Down Arrow (Windows/Linux). The same shortcut can move a selection up or down.


1 Answers

The commands you are looking for are Edit.MoveSelectedLinesUp and Edit.MoveSelectedLinesDown. Shortcuts for them should be defined in the Text Editor context.

like image 187
Sergey Vlasov Avatar answered Oct 05 '22 05:10

Sergey Vlasov