Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Paste as Comment in VS2010?

This is a micro optimization that I'd have in my ideal IDE - the ability to paste from the clipboard directly into the editor as a comment. The idea is sometimes I feel like I lose entire seconds to moving my hand over to the mouse, selecting what I just pasted, having involentary stress over trying to beat the red-squiggly's from appearing, and finally pressing control-K,C.

like image 272
Aaron Anodide Avatar asked Oct 31 '11 16:10

Aaron Anodide


4 Answers

Not exactly what you're looking for, but if you paste with Ctrl + Shift + V (Cycle through the Clipboard Ring), the pasted text is already highlighted and selected for you. You can then follow that up with a Ctrl + K, C to comment it out.

like image 195
Doozer Blake Avatar answered Oct 30 '22 09:10

Doozer Blake


Type /*, Ctrl + V, type */. Your hands never need to leave the keyboard.

like image 7
mikerobi Avatar answered Oct 30 '22 09:10

mikerobi


Try SmartPaster, it's a visual studio 2005, 2008 and 2010 addon which adds paste as comment, string, stringbuilder and region to the right click menu.

like image 3
Johannes Kommer Avatar answered Oct 30 '22 10:10

Johannes Kommer


You might be able to record a macro to do this. In Vs you can use the record macro functionality, you can create your own button in the menu to activate the macro.

like image 2
Orn Kristjansson Avatar answered Oct 30 '22 10:10

Orn Kristjansson