更改ctrl k + c以在Visual Studio中生成c样式注释(//)的c样式注释(/**/) [英] Change ctrl k+c to produce c style comment (/**/) instad of c++ style comments (//) in visual studio
本文介绍了更改ctrl k + c以在Visual Studio中生成c样式注释(//)的c样式注释(/**/)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将Visual Studio中使用的评论样式从//
更改为/*...*/
?
How do i change the comment style used in visual studio from //
to /*...*/
?
我主要使用注释快捷方式暂时注释掉代码.
I use the comment shortcut mostly for commenting out code temporarily.
如果我在下面的代码中选择bool abc
并按ctrl k + c
It annoys me that if i select bool abc
in the code below and press ctrl k+c
void func( bool abc ) {}
它产生
//void func( bool abc ) {}
代替
void func( /*bool abc*/ ) {}
致谢
亨里克
推荐答案
您可以使用宏来实现.使它看起来像这样:
You can do it with a macro. Make it look like this:
Public Sub CommentSelection()
If Not DTE.ActiveDocument.Selection.IsEmpty Then
DTE.ActiveDocument.Selection.Text = "/* " + DTE.ActiveDocument.Selection.Text + " */"
End If
End Sub
将其绑定到Ctrl-K + C以外的其他键,则需要将其保留.
Bind it to a key other than Ctrl-K+C, you'll want to keep that one around.
这篇关于更改ctrl k + c以在Visual Studio中生成c样式注释(//)的c样式注释(/**/)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文