Change ctrl k+c to produce c style comment (/**/) instad of c++ style comments (//) in visual studio

后端 未结 2 1688
迷失自我
迷失自我 2021-01-26 22:08

How do i change the comment style used in visual studio from // to /*...*/ ?

I use the comment shortcut mostly for commenting out code temporar

相关标签:
2条回答
  • 2021-01-26 22:19

    ReSharper does this CTRL + SHIFT + C

    Otherwise, a macro would be your best bet, add this to your VS Macros and bind it to a keyboard shortcut of your choosing:

    edit: removed my crappy code, nobugz beat me.

    0 讨论(0)
  • 2021-01-26 22:28

    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
    

    Bind it to a key other than Ctrl-K+C, you'll want to keep that one around.

    0 讨论(0)
提交回复
热议问题