Home Download Buy Blog Forum Support

Using package setting as part of context list in keybindings

Using package setting as part of context list in keybindings

Postby gregor.hoch on Mon Mar 17, 2014 10:13 am

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?

Code: Select all
{ "keys": ["tab"], "command": "reindent", "context":
   [
      { "key": "setting.auto_indent", "operator": "equal", "operand": true },
      ...
   ]
}
gregor.hoch
 
Posts: 141
Joined: Sat Oct 01, 2011 7:54 pm

Return to Technical Support

Who is online

Users browsing this forum: Exabot [Bot], Google [Bot], Yahoo [Bot] and 33 guests