I like to keep my settings checked into git (mainly so that I can easily work/migrate between machines) and would love to be able to have ST2 settings be loaded from ~/etc/sublime2/... or similar.
I suspect the answer is its not possible right now
import sublime, sublime_plugin
import platform
class SodaThemeColorByHostCommand(sublime_plugin.WindowCommand):
dark_theme = 'Soda Dark.sublime-theme'
light_theme = 'Soda Light.sublime-theme'
dark_machines = ['']
light_machines = ['']
def run(self):
s = sublime.load_settings('Global.sublime-settings')
hostname = platform.node()
if hostname in self.light_machines:
s.set('theme', self.light_theme)
elif hostname in self.dark_machines:
s.set('theme', self.dark_theme)
sublime.save_settings('Global.sublime-settings')
sublime.active_window().run_command('soda_theme_color_by_host')
Reloading plugin D:\MyStuff\Dropbox\Software\Sublime Text 2\Data\Packages\sodacolor.py
Traceback (most recent call last):
File ".\sublime_plugin.py", line 57, in reload_plugin
File ".\sodacolor.py", line 20, in <module>
sublime.active_window().run_command('soda_theme_color_by_host')
AttributeError: 'NoneType' object has no attribute 'run_command'{
"machine1": {
"defined": {
"global": ["theme"]
},
"theme": "Soda Dark.sublime-theme",
},
"machine2": {
"defined": {
"global": ["theme"]
},
"theme": "Soda Light.sublime-theme",
}
}
Users browsing this forum: brad_, Exabot [Bot] and 7 guests