('Tools->Macros->Macro Explorer' or Alt+ F8) and copy paste the code inĪ new module. To create the macro, just go to the macro explorer 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:ĭTE.(0)ĭTE.(True)
Pre VS2017, built-in method using clipboardĪs mentioned, you can just do Ctrl + C Ctrl + V.Ĭtrl + C will copy the line if nothing is selected. You can assign it to a different key combination, or find it in the menu: (edit) This feature is now built-in in VS2017: Ctrl + E, V duplicates a line if nothing is selected, or duplicates selection. Ctrl + D In Visual Studio 2017 (v15.6 and after)Ĭtrl + D In Visual Studio 2017 (pre v15.6)