How to comment multiple lines in Visual Studio Code?

后端 未结 30 1962
感情败类
感情败类 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:03

    You can see all available keybindings on the official documentation.

    Here's the relevant bit for osx:

    Key     Command
    
    ⌘K ⌘C   Add Line Comment    
    ⌘K ⌘U   Remove Line Comment 
    ⌘/      Toggle Line Comment 
    ⇧⌥A     Toggle Block Comment
    

    You will need to select the lines you want to comment first, then execute above shortcut, i.e. ⌘/ on osx Ctrl/ on Windows.

提交回复
热议问题