4

I am new to Visual Studio Code. I want to know how to duplicate a line using a keyboard shortcut.

Please help.
Thanks

informatik01
  • 15,174
  • 9
  • 67
  • 100
Kuldeep Mishra
  • 3,054
  • 1
  • 15
  • 25
  • Also discussed here: [How do I duplicate a line or selection within Visual Studio Code?](https://stackoverflow.com/questions/30203752/how-do-i-duplicate-a-line-or-selection-within-visual-studio-code) – informatik01 Jul 11 '19 at 22:19

1 Answers1

10

In Visual Studio Code you can perform the "Copy line down/up" action. The keyboard shortcut varies depending on your operating system.

The defaults for each os are as follows.

  1. Windows

    Shift + Alt + Up/Down

  2. Macos

    Shift + Option + Up/Down

  3. Linux

    Ctrl + Alt + Shift + Up/Down

Note: This shortcut will also copy multi-line selections up and down as in Sublime but when a subset of a line is selected the entire line is copied.

fanduin
  • 1,069
  • 8
  • 17
  • 2
    The ctrl + alt + shift + Up/Down arrows is not working on linux for Vs Code latest version 1.38.0 – BruneX Sep 07 '19 at 14:34