简体   繁体   English

如何在VS2010中粘贴为评论?

[英]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. 这是我在理想IDE中的微优化 - 能够从剪贴板直接粘贴到编辑器中作为注释。 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. 这个想法有时候我觉得我失去了整整一秒钟将手移到鼠标上,选择我刚刚粘贴的东西,在试图击败红色波浪形的时候出于无意识的压力,最后按下控制-K,C。

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. 不完全是你想要的,但如果你用Ctrl + Shift + V粘贴(循环通过剪贴板环),粘贴的文本已经突出显示并为你选择。 You can then follow that up with a Ctrl + K , C to comment it out. 然后,您可以使用Ctrl + KC对其进行注释。

Type /* , Ctrl + V , type */ . 键入/*Ctrl + V ,键入*/ Your hands never need to leave the keyboard. 你的手永远不需要离开键盘。

试试SmartPaster ,这是一个视觉工作室2005年,2008年和2010年的插件,它将粘贴作为注释,字符串,字符串构建器和区域添加到右键菜单中。

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. 在Vs中您可以使用记录宏功能,您可以在菜单中创建自己的按钮来激活宏。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM