Keyboard shortcut to comment lines in Sublime Text 3

后端 未结 26 2541
深忆病人
深忆病人 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 04:56

    If the shortcut ctrl+?, ctrl+shift+? or ctrl+/ is not working, try switching to another, like ctrl+1, ctrl+shift+1, it worked for me.

    { "keys": ["ctrl+1"], "command": "toggle_comment", "args": { "block": false } }, { "keys": ["ctrl+shift+1"], "command": "toggle_comment", "args": { "block": true } }

    0 讨论(0)
  • 2020-12-02 04:57

    It's simpler than you think press cmd + / in mac.

    0 讨论(0)
  • 2020-12-02 04:58

    You can add the following lines to Preferences / Key Bindings - User:

    { "keys": ["control+keypad_divide"],"command": "toggle_comment", "args": {"block": false} }, 
    { "keys": ["shift+control+keypad_divide"],"command": "toggle_comment", "args": {"block": true}}
    

    This is how I sorted the problem out - replacing "ctrl" with "control" and "/" with "keypad_divide".

    0 讨论(0)
  • 2020-12-02 04:58

    Sublime 3 for Windows:

    Add comment tags -> CTRL + SHIFT + ;
    The whole line becomes a comment line -> CTRL + ;

    0 讨论(0)
  • 2020-12-02 04:59

    I might be late to the party but as of my build 3176 it appears the bug is fixed. Just used Ctrl+T and it worked for a CSS file (Kubuntu 18.10)

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

    This worked for me.

    cmd + /

    I'm on Mac OS X El Capitan. Sublime Text 3 (stable build 3114).

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