Press Ctrl + K .
Ctrl + Shift + / (or Cmd + Shift + / if you're on a Mac). Right click in the current buffer and select HTML Nest Comments -> Comment/Uncomment Selection . Open an HTML file, pop out the console in Sublime Text from View -> Show Console, and type view.
The Basics. The most basic shortcut for creating a comment is Ctrl+K, Ctrl+C.
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".
On a standard US QWERTY keyboard, as used in Australia where Sublime Text is made, / is readily available:
This is not the case with many other keyboards. Take for example the German QWERTZ keyboard. One needs to hit SHIFT+7 to get a /. This is why commenting does not work properly on these keyboards.
Changing the user keybindings to those listed below, will work for the German QWERTZ keyboard.
{ "keys": ["ctrl+7"], "command": "toggle_comment", "args": { "block": false } },
{ "keys": ["ctrl+shift+7"], "command": "toggle_comment", "args": { "block": true } }
If the problems are occurring with still a different keyboard layout, change the keybindings accordingly.
U can fix this bug by:
[
{ "keys": ["ctrl+keypad_divide"], "command": "toggle_comment", "args": { "block": false } },
{ "keys": ["ctrl+shift+keypad_divide"], "command": "toggle_comment", "args": { "block": true } },
]
it allow to comment with CTRL+/ and CTRL+SHIFT+/ and u can use / on keypad =)
This worked for me.
cmd + /
I'm on Mac OS X El Capitan. Sublime Text 3 (stable build 3114).
I'm under Linux too. For me, it only works when I press CTRL+SHIFT+/, and it's like a single comment, not a block comment. The reason is to acceed the / character, I have to press SHIFT, if I do not, sublime text detects that I pressed CTRL + :.
Here it is my solution to get back normal preferences. Write in Key Bindings - User
:
{ "keys": ["ctrl+:"], "command": "toggle_comment", "args": { "block": false } },
{ "keys": ["ctrl+shift+:"], "command": "toggle_comment", "args": { "block": true } }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With