VS Code Keyboard Shortcuts/Copy line up/down

Duplicate current line or selection.

Section: Editor Editing

Copy line up/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 Editor Editing
Join lines
Join selected lines or current line with next line.
OpenIn sheettextsame section
Toggle word wrap
Switch editor wrapping on and off.
OpenIn sheettextsame section
Trim trailing whitespace
Remove trailing spaces in active file.
OpenIn sheettextsame section
Change file language mode
Set syntax highlighting / language mode manually.
OpenIn sheettextsame section
New window
Open a new VS Code window.
Quick Open
Search and open files.