Move line Up/Down shortcut in Visual Studio 2012

Install ReSharper.

Open Tools -> Options -> Environment -> Keyboard (as shown in a picture)

  1. Find "ReSharper.ReSharper_MoveUp"
  2. In "Use new shortcut in:" choose: "Text Editor"
  3. Click in "Press shortcut keys:" and press your shortcut (for example Alt+ArrowUp)
  4. Press "Assign" button Same with with "ReSharper.ReSharper_MoveDown"

P.S. Works fine for single lines and multiple selected lines, but removes selection after moved 1 line. Hope there are way to move multiple lines multiple times in one selection.


For those who arrived on this question using Visual Studio 2013 or above, the feature is built right into the program. Just use AltUp and AltDown to move the line with your cursor—or the selected lines—up and down.

If you wish to rebind it in Tools > Options > Environment > Keyboard, the keys are Edit.MoveSelectedLinesUp and Edit.MoveSelectedLinesDown. You may need to remove your new combination from other existing keys first.


Update: huzzah, Productivity PowerTools VS2012 is now available and offers this functionality (along with another personal favorite, Tools.AddEndTokenAtTheEnd.)

MoveLine Extension (compatible with VS 2012; I had to manually restart my VS in order to see the commands in VS's keyboard shortcut tool.)