Sublime Forum

Reading settings files from a keymap context

#1

I’m working on a plugin where I’ve put the settings into their own file, and now I need to be able to access those settings from a keymap. To illustrate, here’s the essential parts of the plugin folder:

/Packages/MyPlugin
    /Default.sublime-keymap
    /MyPlugin.sublime-settings

The settings file looks like this:

{ "hotkey_enabled" : true }

In the keymap file, I have something like this:

[code]{ “keys”: “…”], “command”: “…”, “context” :

        { "key": "setting.???", "operator": "equal", "operand": true, "match_all": "true" }
    ]

}[/code]

It’s the “???” in the keymap file, which has me stumped. Trying “setting.MyPlugin.hotkey_enabled” or “setting.hotkey_enabled” doesn’t work… what’s the right way?

0 Likes

#2

bump

0 Likes

#3

Thanks for the help! For my purposes, I think I’ll have to leave it in Base File

0 Likes