Troubleshooting keyboard shortcuts in Sublime Text

I recently installed a couple of new plugins to Sublime Text, and then Ctrl+Shift+R, the shortcut for searching through all symbols in a project, stopped working!

You can get Sublime Text to display what’s actually going on when you press the shortcut — that information may give you a hint as to what plugin or configuration has changed your value.

Is the shortcut reaching Sublime?

The following commands are run in the Sublime Text Console; you can access on Linux and Windows by pressing Ctrl+`.

You can check the shortcut is actually managing to get to Sublime in the first place:

sublime.log_input(True)

You’ll notice that the console will now display the keys that you press — try pressing a keyboard shortcut too!

key evt: shift+control+r

If the console is showing your keystrokes correctly, then Sublime is receiving them loud and clear and the problem lies elsewhere.

What is Sublime doing when the shortcut is invoked?

By running the following in the Sublime console, you’ll see what commands Sublime is running as you press keyboard shortcuts:

sublime.log_commands(True)

You’ll now note the command names appearing inside of the console. I got the following:

key evt: shift+control+r
command: run_emmet_action {"action": "reflect_css_value"}

In my case, it turned out that Emmet had taken over the shortcut! I got my shortcut back by copying the default Ctrl+Shift+R shortcut definition from Preferences > Keybindings - Default and pasting it in to the user file at Preferences > Keybindings - User.

[
	{ "keys": ["ctrl+shift+r"], "command": "goto_symbol_in_project" }
]

I feel there should be a better way to do this, but this works as Sublime is now. Now I try the shortcut again:

key evt: shift+control+r
command: goto_symbol_in_project

Much better.

Emmet has its own special shortcut handling

Those of you familiar with Emmet might know that it has its own built-in mechanism to disable keyboard shortcuts of your choice. And in this case, that’s exactly what could be used.

"disabled_keymap_actions": "reflect_css_value"

The nice thing about the keybindings override is that the instructions described above should work for any addon package as the User package is sourced last — meaning that the User package overrides all.