How to diagnose and fix key-binding conflict in Su

2019-01-20 09:47发布

问题:

My default key-bindings for pasting are

{ "keys": ["ctrl+v"], "command": "paste" },
{ "keys": ["ctrl+shift+v"], "command": "paste_and_indent" },

I've overridden them in my user key-bindings with

{ "keys": ["alt+k"], "command": "paste" },
{ "keys": ["ctrl+k"], "command": "paste_and_indent" },

(I use Dvorak, which means your V is my K. Also, I want paste_and_indent to be the default.)

But ctrl+k executes paste, not paste_and_indent. I determined this by turning on command logging in the console, with

sublime.log_commands(True)

However, if I make the paste_and_indent command to something else, like ctrl+alt+k or alt+k, it correctly calls paste_and_indent.

I've looked through the key-bindings for all of my installed packages, and don't see any other command using ctrl+k. I've also disabled pretty much every package except syntaxes (I even accidentally disabled Package Control), but still, ctrl+k only executes paste.

How can I determine and fix this conflict, so ctrl+k executes paste_and_indent?

回答1:

Check out the FindKeyConflicts plugin. There are several options for looking at all key bindings, or just conflicting ones, in a variety of contexts. All the options are available via the Command Palette.