Celeb Glow
news | March 05, 2026

Keyboard shortcut to move line up/down in Visual Studio 2012?

Is there a shortcut to move a line up/down?

Visual Studio 2010 Productivity Power Tools had this feature, is it built-in on Visual Studio 2012? Is there perhaps a light extension that adds this feature?

3 Answers

I found an extension for it: MoveLine

Compatible with VS2012. Moves a line, or group of lines, up or down in the editor using shortcut keys. Press the shortcut keys to move the line under the cursor up or down or select a block of text and press the shortcut keys to move the entire block up or down.

The default shortcut keys are as follows:

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

To change the shortcut keys:

  • In the Visual Studio main menu go to Tools → Options
  • Expand Environment
  • Select Keyboard
  • In the Show commands containing box type Tools.MoveLineUp or Tools.MoveLineDown
  • In the Press shortcut keys box press the new shortcut keys
  • Click Assign
3

Update Visual Studio 2013+

VS 2013+ should have this editor action built in - if you want to assign keybindings, go to:

  1. Tools > Options > Keyboard

  2. Search for the commands:

    Edit.MoveSelectedLinesUp
    Edit.MoveSelectedLinesDown
  3. Set the shortcut keys in "Text Editor" scope

example

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

Shift+Alt+T moves the current line down. Look for "Edit.LineTranspose" in Pre-defined Keyboard Shortcuts.

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy