Sublime Forum

Custom key-binding breaking others

#1

I originally setup a custom key binding so that I could tap escape to open GoTo anything. This worked fine and was awesome until I realised that in doing so I had essentially broken pressing escape for other things (at the moment I only know it’s affected the search functionality). Being someone who prefers to navigate with the keyboard when doing a search I simply ctrl+f, type what I want, hit return until I get to the instance I want and pressed escape… nothing happened, the find panel stayed. Damnit! So I changed the key binding to open GoTo when I double tap escape, great! That’ll d… no. That didn’t do it…

Is there anyway I can achieve the functionality I want with the single escape press?

My custom binding is as follow -

{ "keys": "escape"], "command": "show_overlay", "args": { "overlay": "goto", "show_files": true } }

Thanks in advance,
Loggie

0 Likes

#2

I suggest using an alternative keystroke. Sublime uses Esc to cancel a variety of things from S&R, build output, multiple cursors and field entry mode in snippets.

0 Likes

#3

I also recommend using a different binding, but you can achieve what you want by copying all the “escape” bindings from the default file over to your user file - and most importantly below your custom binding. Afaik ST will always trigger the first binding whose context matches while going from the latest defined to the first (User -> Plugins -> Default, considering order in the file).

0 Likes

#4

Thanks for this. If I come across any other problems with it breaking something then I’ll probably just change to a different binding.

0 Likes