Keyboard shortcut to comment lines in Sublime Text 3
In Sublime Text 2 it was possible to comment out a line or a block of lines with Ctrl+/ and Ctrl+Shift+/. According to the menu Edit > Comment
these shortcuts should be valid, but in Sublime Text 3 (build 3047) they no longer seem to work. Does anybody know the right default keyboard shortcuts for Linux and MacOS? Or is it a bug?
It seems a bug: http://www.sublimetext.com/forum/viewtopic.php?f=3&t=11157&start=0
As a workaround, go to Preferences
->Key Bindings - User
and add these keybindings (if you're using Linux):
{ "keys": ["ctrl+7"], "command": "toggle_comment", "args": { "block": false } },
{ "keys": ["ctrl+shift+7"], "command": "toggle_comment", "args": { "block": true } }
Update: This also works on Windows 8 (see @Sosi's comment)
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".