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

后端 未结 2 1728
迷失自我
迷失自我 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: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.

提交回复
热议问题