Visual Studio /**/ comment shortcut?

前端 未结 8 2253
长发绾君心
长发绾君心 2021-02-01 01:53

I want to know how to put the /**/ comments through shortcut. I know the Ctrl+K+C shortcut for the // comments but it comments the whole lin

相关标签:
8条回答
  • 2021-02-01 01:57

    Shift + Option + A - figured it out by going to Preferences > Keyboard Shortcuts and searching "comment"

    0 讨论(0)
  • 2021-02-01 01:59

    You can now use Ctrl + Shift + A /* for block comments */

    And Ctrl + ù // for line comments

    0 讨论(0)
  • 2021-02-01 02:00

    Visual studio comment shortcut key: Accept in HTML, C#, JS, CSS etc in Visual studio.

    Ctrl + k + c

    //a
    //b                      
    //c
    

    to undo ctrl + k + u

    a
    b
    c
    

    Ctrl + Shift + /

    /*a
    b
    c*/
    

    to undo Ctrl + Shift + /

    a
    b
    c
    
    0 讨论(0)
  • 2021-02-01 02:01

    I think there is no shortcut key for this purpose in Visual Studio but If you use ReSharper you can use Ctrl + Shift + /.

    Have a look at this may be useful as well.

    0 讨论(0)
  • 2021-02-01 02:07

    VS 2019 I did

    Tools > Options > Environment > Keyboard

    Type in Edit.ToggleBlockComment and add a keybinding. I chose shft + ctrl + /

    Or you could put comment in the search box of the keyboard section and look at all your comment keybinding shortcut options.

    0 讨论(0)
  • 2021-02-01 02:08

    To comment a block of code (more than one line) in VS select code with ALT (alt+mouse or alt+shift+arrows), and then comment with Ctrl+K Ctrl+C. With one line code only you don't need ALT.

    So it's basically the same as with // comments, only ALT needs to be pressed while selecting code for more lines than one.

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