Sublime Forum

Using package setting as part of context list in keybindings

#1

Hi,

is it possible to use settings defined in a package setting file as part of keybindings “context” argument? Below is an (abbreviated) example from the default keybindings files. This keybinding is only valid when setting.auto_indent is true. I have a my_package.sublime-settings file in my package and would like to add keybindings that only work when a certain setting is true (let’s say the ‘use_keys’ setting defined in my_package.sublime-settings). How does that work? setting.use_keys doesn’t work and probably would be problematic because it overwrites default settings. setting.my_package.use_keys doesn’t work either. Any way to do this?

{ "keys": "tab"], "command": "reindent", "context":
	
		{ "key": "setting.auto_indent", "operator": "equal", "operand": true },
		...
	]
}
0 Likes