Sublime Forum

Map 1 key to 2 sequenced commands?

#1

Is it possible to map to a single key press to two commands executed sequentially?

i.e.
{ “keys”: “super+shift+e”], “command”: “slurp_find_string”, “command”: “show_panel”, “args”: {“panel”: “find_in_files”} },

Tries ‘select text under cursor, bring up the Fin in project’, by merging:
{ “keys”: “super+e”], “command”: “slurp_find_string” },
{ “keys”: “super+shift+f”], “command”: “show_panel”, “args”: {“panel”: “find_in_files”} },

It doesn’t work by the way.

If key mapping doesn’t work, could I do a custom macro for this?

0 Likes

#2

either trigger a macro

{ "keys": "…"], "command": "run_macro_file", "args": {"file": "res://Packages/…/….sublime-macro"} }

or use the run_multiple_commands command

0 Likes

#3

I found a couple bugs in the run_multiple_commands plugin posted. I’ve fixed a handful of them and put them up as part of ImprovedMacros. Never got around to finishing the functionality I want, but you can manually install the plugin with package control and use the run_multiple_commands command. For an example of how to use it, see the forum post @valerij_ posted or here.

0 Likes