Sublime Forum

Redundancy in customised .sublime-keymap & .sublime-menu

#1

Assume I am placing a user entry in my “Main.sublime-menu” and the “args” assignment of that entry is relatively long.

If I want to create a keyboard shortcut to the same command, I have to repeat essentially the whole block (in particular, the whole content of the “args” dictionary) in my “Default (Linux).sublime-keymap”.

Is there any way to avoid the redundancy in this situation?

0 Likes

#2

In general, all of *.sublime-... files are unrelated to each other and can’t reference each other.

Your best chance might be to put your long command into a sublime-macro file and create entries in all relevant files to call it.

1 Like

#3

That was what I expected, just wanted to make sure. Thank you!

P.S. There is a hash-based solution to a very similar problem in Thunar file manager: linking the shortcut to a custom command (also configured in different files) via a random key string, which is long enough to likely avoid collisions – but there the handling is automatic. Something like this in “human-edited” files would certainly feel awkward.

0 Likes