Shortcut for commenting CSS in VS 2008

前端 未结 2 820
野趣味
野趣味 2021-01-03 08:32

When I press the standard Ctrl + E, C (an other variants) in VS2008 whilst editing a CSS file, it says that command is not available. How do I setup a shortcut to apply a pl

2条回答
  •  再見小時候
    2021-01-03 09:09

    here's an even simpler solution:

    Sub CommentCSS()
        DTE.ActiveDocument.Selection.StartOfLine(VsStartOfLineOptions.VsStartOfLineOptionsFirstText)
        DTE.ActiveDocument.Selection.Text = "/*"
        DTE.ActiveDocument.Selection.EndOfLine()
        DTE.ActiveDocument.Selection.Text = "*/"
    End Sub
    

    you can record it yourself using ctrl+shift+R

    1. place the cursor on the line you want to comment
    2. press "Home" on your keyboard
    3. type /*
    4. press "End" on your keyboard
    5. type */
    6. save your recording

提交回复
热议问题