Home Download Buy Blog Forum Support

Plugin Settings

Plugin Settings

Postby namtzigla on Sun Jul 31, 2011 11:57 pm


I'm looking for a way to have some sort of settings file for my plugin, is there any standard way to do this ?

Posts: 2
Joined: Sun Jul 31, 2011 10:21 pm
Location: SXM

Re: Plugin Settings

Postby Kevin Yank on Mon Aug 01, 2011 1:19 am

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.
Kevin Yank
Posts: 19
Joined: Sat Jul 30, 2011 6:31 am

Re: Plugin Settings

Postby jps on Mon Aug 01, 2011 10:49 pm

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 http://www.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"
Site Admin
Posts: 3217
Joined: Wed Mar 19, 2008 12:33 pm

Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 2 guests