How to comment multiple lines in Visual Studio Code?

后端 未结 30 2007
感情败类
感情败类 2020-11-28 00:23

I cannot find a way to comment and uncomment multiple lines of code in Visual Studio Code.

Is it possible to comment and uncomment multiple lines in Visual Studio Co

30条回答
  •  清歌不尽
    2020-11-28 01:11

    How to comment out multiline / single line in VS Code:


    MacOS:

    Shift + Option + A:

    /* multiline    
       comment */
    

    CMD + /:

    // single line comment    
    

    Windows:

    Shift + Alt + A:

     /* multiline
        comment */
    

    CTRL + /:

    // single line comment
    

    How to remap / change these shortcuts?

    Windows: File > Preferences > Keyboard Shortcuts.

    MacOS: Code > Preferences > Keyboard Shortcuts.

    You can search through the list both by keybindings (key names) and command names.


    Read: How to set shortcuts from another text editor (Sublime, Atom etc)?

    Official docs: Key Bindings for Visual Studio Code

提交回复
热议问题