Languages
[Edit]
EN

VS Code - duplicate current line

7 points
Created by:
AnnLen
1798

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.
Hey ūüĎč
Would you like to know what we do?
  • Dirask is a friendly IT community for learners, professionals and hobbyists to share their knowledge and help each other in extraordinary easy way.
  • We welcome everyone,
    no matter what the experience,
    no matter how basic the question is,
    this community will help you.