Move Block Up/Down Using Keyboard

Use the keyboard to move a line or selection up or down in your file.

Move lines and blocks, up or down, using the keyboard.

When you're in the flow, you want to re-arrange code fast. Use this tip to move code around without cut-and-paste.

In Depth

We want to operate on code in the editor fast. Using Cut-and-Paste is kinda fast, but there's a better way that doesn't temporarily remove the code from your file.

Make a selection (without using the mouse) and use (Shift-Alt-Up/Down Win/Linux, Alt-Shift-Up/Down macOS) to move that selection to the target line. The selection gets dragged along, in view.

With cut-and-paste, you have semi-dangerously remove your code, then make a new line to put place the selection, then paste.

Full Video