Languages
[Edit]
EN

VS Code - duplicate current line

7 points
Created by:
AnnLen
12070

In this short article we would like to show how to duplicate / copy current line in VS Code.

Simple steps:

  1. put caret to line that you want to copy,
  2. use one keys combination from below table,
    Depending on operating system:
     Keys combination Operating System

    Shift+Alt+Up/Down

    on Windows

    Shift+Option+Up/Down

    on Mac
    Ctrl+Shift+Alt+Up/Downon Ubuntu

Using VS Code menu

It is possible to make copy from options in VS Code menu.

Simple steps:

  1. put caret to line that you want to copy,
  2. go to VS Code menu and use:
    Selection -> Copy Line Up
    or
    Selection -> Copy Line Down

Screenshot:

Duplicate current line option in VS Code menu on Windows.
Duplicate current line option in VS Code menu on Windows.
Native Advertising
­čÜÇ
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

ÔŁĄ´ŞĆ­čĺ╗ ­čÖé

Join