VS Code Cheat Sheet/Copy line up or down

Duplicate the current line or selection.

Section: Basic Editing

Copy line up or down

text
text
Windows/Linux: Shift+Alt+Up / Shift+Alt+Down
macOS: Shift+Option+Up / Shift+Option+Down

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Basic Editing
Move line up or down
Reorder code without cut/paste.
OpenIn sheettextsame section
Delete line
Remove the current line quickly.
OpenIn sheettextsame section
Insert line below
Open a new line below without moving manually.
OpenIn sheettextsame section
Insert line above
Open a new line above the current line.
OpenIn sheettextsame section
Format document
Format the entire active file.
OpenIn sheettextsame section
Open Command Palette
Run any VS Code command quickly.