Home Download Buy Blog Forum Support

Keymap context: plugin setting

Keymap context: plugin setting

Postby DSHugo on Fri Oct 14, 2011 9:07 pm

Hello everybody.

Does anybody happen to know, if it is possible to reference a plugin-specific setting in .sublime-keymap file as context? Currently, it is possible to reference a global setting, just like this:
Code: Select all
    ...
    "context": [
      { "key": "setting.some_global_setting", "operator": "equal", "operand": true }
    ],
    ...


Just wanted to ask if it is mandatory to create a global setting to reference it in keymap, instead of using plugin setting within plugin keymap.
DSHugo
 
Posts: 42
Joined: Tue Sep 20, 2011 11:05 am

Re: Keymap context: plugin setting

Postby DSHugo on Sat Oct 15, 2011 8:34 am

Uh, I've probably been totally unclear. By global setting I meant Defaults/Base File.sublime-settings and User/Base File.sublime-settings. By plugin (local) setting I meant something, which is present in MyPlugin/MyPlugin.sublime-settings and User/MyPlugin.sublime-settings.

The thing why I ask this, is that I have a plugin with a whole bunch of defaults. When an end-user wants to customize it, he/she creates a corresponding file in User/ directory and overrides separate settings, as usual. I want to reference one of these settings in keymap, but, as far as I see, I can only use something from Defaults(or User)/Base File.sublime-settings, but not MyPlugin(or User)/MyPlugin.sublime-settings. In this case, end-user would have to edit both User/Base File.sublime-settings and User/MyPlugin.sublime-settings to fully customize the plugin.
DSHugo
 
Posts: 42
Joined: Tue Sep 20, 2011 11:05 am

Re: Keymap context: plugin setting

Postby jps on Sat Oct 15, 2011 11:25 pm

There's no inbuilt support for it, but you can add your own contexts via a plugin, via on_query_context.
jps
Site Admin
 
Posts: 3077
Joined: Wed Mar 19, 2008 12:33 pm


Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 8 guests