Sublime Forum

Custom key binding being overridden

#1

I’m attempting to add custom key bindings for moving files from one pane to another. Rather than using ctrl+shift+1 [2, 3, etc], I’d like to use ctrl+shift+keypad1 [2, 3, etc]. I’ve added the following to my user key bindings file:

{ "keys": "ctrl+shift+keypad1"], "command": "move_to_group", "args": { "group": 0 } },
{ "keys": "ctrl+shift+keypad2"], "command": "move_to_group", "args": { "group": 1 } }

Those keys bindings were not acting as they should, so per the forums, I ran…

sublime.log_commands(True)
sublime.log_input(True)

At that point, I can see the following occurs when I attempt to use the key bindings…

move_to {"extend": false, "to": "eof"}
run_emmet_action {"action": "decrement_number_by_1"}

So, two questions:

  1. If I add a key binding to my user file, does that not override any key binding defined elsewhere?
  2. I searched every file (I believe) to see where those key bindings might be (ie, emmet), but don’t see anything that specifies a key binding for ‘keypad1’ or ‘keypad2’. Where are these defined?

Thanks so much!

0 Likes

#2
  1. Yes it should override key combinations defined elsewhere as it is loaded last.

I used your keybindings and looked at the logged input. It looks like it’s seeing “ctrl+end” rather than “ctrl+shift+keypad1” like you want. Do you see something similar? If so, that’s probably why you aren’t seeing the desired behavior.

0 Likes