What is the key for duplicating a line in Microsoft Visual Studio 2012? (in Notepad++ it is ctrl+D )
3 Answers
Check this extension:
- Duplicate Selection extension : http://visualstudiogallery.msdn.microsoft.com/830a6482-3b8f-41a8-97b5-b9c581e5ad8b
Duplicate the line without touching the clipboard (as Notepad++ does).
Just to make it absolutely clear
ctrl-C at the start of a line copies the whole line without your needing to select it
source Shortcut for duplicating a line of code in Visual Studio 11
-
3Ctrl-C should copy the whole line from anywhere on the line.– 10gisticCommented Jan 24, 2013 at 15:05
-
4Copying and pasting isn't the same as duplicating as ctrl+D in N++ preserves the contents of the clipboard. In VS2010 I had a macro to do this but macros don't seem to be around anymore :-( If anyone knows a way to do it again in 2012 that would be really helpful.– BenCommented Mar 7, 2013 at 9:38
Here's a list of keyboard shortcuts, but don't see a duplicate on it. Ctrl+C/Ctrl+V may be your best bet or see if there's something you can define under Tools>Options>Keyboard.