Duplicate a Line in VS Code (Copy Line Down) + Shortcuts

Suman SharmaSuman Sharma

Duplicate a line in VS Code (Copy Line Down)

Most of us spend a lot of time in Visual Studio Code. Shortcuts are a big part of what makes it fast: less menu hunting, more flow.

One of the most useful actions is Copy Line Down — duplicate the current line (or selection) without touching the clipboard.

Set up Copy Line Down

  1. Open Settings → Keyboard Shortcuts (or File → Preferences → Keyboard Shortcuts on Windows/Linux).
  2. Search for Copy Line Down.
  3. Click the pencil icon to edit the binding, press the key combination you want, then press Enter.
VS Code keyboard shortcuts UI showing Copy Line Down

The default on Windows is usually Shift+Alt+Down Arrow. On macOS it is often Shift+Option+Down Arrow.

More VS Code shortcuts worth memorizing

1. Command Palette (Show All Commands)

  • Windows / Linux: Ctrl+Shift+P
  • macOS: Cmd+Shift+P

Open the palette and type a few letters of any command — no nested menus. You can also see and change keybindings from here.

Screen recording of VS Code Command Palette in use

2. Quick Open (go to file)

  • Windows / Linux: Ctrl+P
  • macOS: Cmd+P

Jump to a file by name. Use Up / Down to move in the list; Right Arrow opens the file in the background so you can keep picking files without losing your place.

Screen recording of VS Code Quick Open file picker

3. Toggle sidebar

  • Windows / Linux: Ctrl+B
  • macOS: Cmd+B

Hide or show the sidebar when you want the editor full width.

Screen recording of toggling the VS Code sidebar

4. Close the active editor tab

  • Windows / Linux: Ctrl+W
  • macOS: Cmd+W

Closes the current tab — handy when many files are open.

5. Integrated terminal

  • Toggle terminal: Windows / Linux: Ctrl + backtick · macOS: Cmd + backtick
  • New terminal: Windows / Linux: Ctrl + Shift + backtick · macOS: Cmd + Shift + backtick

Use the first to show or hide the panel; use the second when you need an additional terminal instance.

6. Start debugging

  • All platforms: F5

Starts debugging with the current launch configuration — great once your launch.json is set up.

Happy coding — keep learning and keep your shortcuts under your fingers.

Contact

Get in Touch

Want to call me? book a call and I'll respond in the available time slot. I will ignore all soliciting.

GitHub
LinkedIn
youtube