Move Block Up/Down Using Keyboard

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

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 ⌥⇧↑ (macOS) / Shift+Alt+Up Arrow (Windows/Linux) or ⌥⇧↓ (macOS) / Shift+Alt+Down Arrow (Windows/Linux) 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.


Related Resources

See VCS Changed Lines In Gutter
Quickly spot which parts of your file have changed since the last commit.
Autocomplete Django Settings Strings
Use autocomplete when typing a string in the apps section of your settings file.
Split Screen Without Tabs
Get your code and tests side-by-side without resorting to tabs.