Aaron Anodide
Aaron Anodide

Reputation: 17196

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.

Upvotes: 11

Views: 1277

Answers (4)

mikerobi
mikerobi

Reputation: 20878

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

Upvotes: 7

Johannes Kommer
Johannes Kommer

Reputation: 6451

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.

Upvotes: 3

Doozer Blake
Doozer Blake

Reputation: 7797

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.

Upvotes: 12

Orn Kristjansson
Orn Kristjansson

Reputation: 3485

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.

Upvotes: 2

Related Questions