Keyboard shortcut to comment lines in Sublime Text 3

后端 未结 26 2542
深忆病人
深忆病人 2020-12-02 04:42

In Sublime Text 2 it was possible to comment out a line or a block of lines with Ctrl+/ and Ctrl+Shift+/. According t

相关标签:
26条回答
  • 2020-12-02 05:08

    Open sublime Text 3 and go to Preferences menu and the click on Key Bindings then paste this code to make a comment shortcut with CTRL+D.

    [{ "keys": ["ctrl+d"],"command": "toggle_comment", "args": {"block": false}},]
    

    then save it. now you can use shortcut.

    0 讨论(0)
  • 2020-12-02 05:09

    Make sure the file is a recognized type. I had a yaml file open (without the .yaml file extension) and Sublime Text recognized it as Plain Text. Plain Text has no comment method. Switching the file type to YAML made the comment shortcut work.

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