Sublime Forum

See what command is bound to a key

#1

Is there a way that I can press a key combination, and see what command would be executed as a result? I know I can look in the key bindings file, but that’s not quite what I’m after as the defaults can be overridden by user settings or plugins. There are a few cases where I’ve hit situations where I would have found this useful:

  • When I hit what I thought
    was the right key, but it wasn’t. It did something, but I can’t quite see what and I want to check (Hitting “undo” is often enough in this case, admittedly).

  • When a key doesn’t work the way I thought it should (Ctrl-backtick isn’t working for me, for instance) and I want to see what Sublime thinks is happening.

  • There is a binding I want to use for a custom action, and I want to check it’s not already in use for something I’d forgotten about.

Thanks,
Paul

0 Likes

#2

Just the forum for sublime.log_commands. There are instructions around here somewhere.

0 Likes

#3

Thanks. That’s what I was looking for. Oddly, one of my issues (Ctrl-does not toggle the console on Windows 64-bit) seems to be something else. After experimenting a bit further, it looks like Ctrl+ (backquote) does nothing, but keys mapped to it are activated by Ctrl+’ (single quote).

Strange. Could this be a bug? If so, I’m a little surprised if I’m the first one to have encountered it… :confused:
Paul

0 Likes

#4

sublime.log_commands(True) in the console is the best way to view what commands are being run. As a reminder, the console can be brought up through View -> SHow console if they keybinding isn’t working (You can then see what is being run :smile:). In addition, I wrote the FindKeyConflicts plugin to help solve problems like this (granted I wasn’t aware of sublime.log_commands before). The plugin would be particularly useful for the 3rd point. One of the commands list all keybindings.

1 Like