Hi,
I’m looking for a way to have some sort of settings file for my plugin, is there any standard way to do this ?
thanks
Florin
Hi,
I’m looking for a way to have some sort of settings file for my plugin, is there any standard way to do this ?
thanks
Florin
Sure! What you’re looking for is a .sublime-settings file. To create settings that will apply to all file types, create a “Base File.sublime-settings” file in your package directory (alongside your plugin’s .py file). The user will be able to override the defaults set in that file by adding the settings to the “User/Base File.sublime-settings” file.
You can also specify platform-specific and file-type-specific default values for your settings. For full details, see the Settings page in the Sublime Text 2 wiki.
Alternatively, if you don’t want to use the file settings, you can use “MyPlugin.sublime-settings”, and load the settings via sublime.load_settings(“MyPlugin.sublime-settings”) - see sublimetext.com/docs/2/api_reference.html. This will still use the standard merging facilities, so you can specify platform specific overrides in “MyPlugin (OSX).sublime-settings” and user specific overrides in “User/MyPlugin.sublime-settings”