xxxxxxxxxx
Shift + Alt + Down or Shift + Alt + Up
xxxxxxxxxx
//------------ How to duplicate lines of code? --------------//
-> Windows:
Shift + Alt + Down and Shift + Alt + Up
-> Mac:
Shift + Option + Down and Shift + Option + Up
-> Linux:
Ctrl + Shift + Alt + Down and Ctrl + Shift + Alt + Up
xxxxxxxxxx
In Visual Studio 2022
Ctrl + E,V
In Visual Studio 2019
Ctrl + D
In Visual Studio 2017 (v15.6 and after)
Ctrl + D
xxxxxxxxxx
---------------- Windows ---------------
Duplicate Line Up : Shift + Alt + Up
Duplicate Line Down : Shift + Alt + Down
---------------- Linux ------------------
Duplicate Line Up : Ctrl + Shift + Alt + 8.
Duplicate Line Down : Ctrl + Shift + Alt + 2.
xxxxxxxxxx
In the search field, type
^(.*)(\n\1)+$
replace $1 for remove duplicate line