Move Line Up / Down
What is Move Line Up / Down?
Move Line Up / Down: Move the current line (or selected block) up or down without cut-and-paste. Move line up or down shifts the current line, or a selected block, one line at a time without cutting and pasting. In VS Code it is Alt+Up/Down or Option+Up/Down. JetBrains IDEs use Alt+Shift+Up/Down or Option+Shift+Up/Down. It is handy for reordering statements, list items, CSS rules or array entries. Your clipboard stays untouched, and the editor keeps indentation correct as the line moves.
Frequently asked questions about Move Line Up / Down
What should you keep in mind with Move Line Up / Down?
JetBrains also offers "move statement", Ctrl+Shift+Up/Down, which moves a whole method or block as a unit and respects the code structure. Combined with duplicate line and delete line, these shortcuts handle most of the small edits you make all day without reaching for the mouse.
At a glance
| Category | Keyboard shortcuts |
|---|---|
| Explained by | Reinier de la Parra |
| Updated |