Sublime Forum

I can't comment by keyboard shortcut?

#1

I used to be able to comment by doing ctrl+/, but now it’s not working, for some odd reason. I already checked my keybindings and it is defined as as ctrl+/ still…

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

What am I missing? I tried commenting on .py files as well as .cpp and .html and it’s not working in any…

0 Likes

#2

You can enable ST’s command logging via sublime.log_commands(True) in ST’s console to see what command is actually triggered when you press that keybinding.

0 Likes

#3

Remind me please, how do I enable the console?

0 Likes

#4

ctrl + backtick

0 Likes

#5

Great… Another keyboard shortcut that doesn’t work… Can’t one do it via the menu bar?

0 Likes

#6

I just removed everything in .config/ST3, relaunched ST and tried to see if commenting works with the default config (with no extensions and whatnot) and to see if I could open the terminal…

Surprise! No, I could not.

0 Likes

#7

There should be a little icon in the bottom-left corner of ST.
image

But I don’t think a plugin is going to occupy the shortcut of the console.

0 Likes

#8

View -> Show Console. Enabled the logs and noticed that Ctrl+/ actually gives ctrl+7 for some reason. Changed the keybind to ctrl+7 and now it works.

Really weird that nothing works out of box in ST for me. Oh well. Thanks for the help mate.

0 Likes

#9

Something else to look at if you’re having problems with the comment command not working is to check the syntax that’s set for the file you’re trying to use the command in. For example, the comment command does not work in a plain text file. I have multiple syntaxes for Javascript and commenting works differently between them. Other syntax types may not support the comment command or the behavior may vary from what you expect.

0 Likes