From the course: Visual Studio Tips and Techniques for Developers
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Duplicate lines of code - Visual Studio Tutorial
From the course: Visual Studio Tips and Techniques for Developers
Duplicate lines of code
- Here's a quick tip on a small but useful feature that first appeared in Visual Studio 2017. It provides a way to duplicate code without losing the existing content of the clipboard. You can find this command in the edit menu and it's called duplicate. And I'll be working with the control D shortcut. So the way this works is you put your cursor on a line of code. Here I'm on the end of line 22. Press control D, and you get a duplicate of that line This works if the cursor's at the beginning of the line like this, and it works wherever the cursor is. So if I put the cursor in the middle of line 25, right there, select that text, control D. When you've got text selected it duplicates the text that you selected. If you have your cursor just in the line of code, it duplicates the line. This also works with multiple line examples. So if I select these last two lines like this and do a control D, it duplicates both…
Contents
-
-
-
Solution filters for customized project loading3m 29s
-
(Locked)
Get a filtered file view in Solution Explorer2m 36s
-
(Locked)
Solution Explorer and Scope to This2m 25s
-
(Locked)
Add keyboard shortcuts for Git commands1m 57s
-
(Locked)
Customize the editor for a given file extension2m 56s
-
Sort and group your files with vertical tabs3m 10s
-
(Locked)
Extension: Text generator2m 26s
-
(Locked)
Extension: Code converter (VB to C#)4m 11s
-
(Locked)
Duplicate lines of code2m 8s
-
(Locked)
Browse the application in multiple browsers2m 48s
-
(Locked)
Better output window with the MetaProject extension5m 36s
-
(Locked)
Preview image and data files with the MetaProject extension4m 20s
-
-