Sublime Forum

How to prefill the command palette?

#1

I have developed several commands as part of a package Foo and have given each command a caption of Foo: [command] in my .sublime-commands file. Is there a way I can open the command palette already prefilled with Foo: to more easily search my commands in the command palette? I would like to ultimately trigger this with a key binding.

0 Likes

#2

Maybe …

	{ "keys": ["the key binding"], "command": "show_overlay", "args": {"overlay": "command_palette", "text": "Foo: "}, "context":
		[
			{ "key": "selector", "operator": "equal", "operand": "text.html", "match_all": true },
		]
	},

It would enable the binding within text.html scope and display command palette prefilled.

2 Likes

#3

That works! Thank you.

0 Likes