Is there a shortcut for Duplicate Line command in Visual Studio 2008? Some similar
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In Visual Studio 2022
Ctrl + E, V
In Visual Studio 2019
Ctrl + D
In Visual Studio 2017 (v15.6 and after)
Ctrl + D
In Visual Studio 2017 (pre v15.6)
(edit) This feature is now built-in in VS2017: Ctrl + E, V duplicates a line if nothing is selected, or duplicates selection. You can assign it to a different key combination, or find it in the menu:
See this reference for more information.
Pre VS2017, built-in method using clipboard
As @cand mentioned, you can just do Ctrl + C ; Ctrl + V.
Ctrl + C will copy the line if nothing is selected.
Macro solution (pre VS2017)
If you’d like to implement a more complete solution, perhaps to create a simpler keyboard shortcut or you don’t want to effect the clipboard, see this guide: