There’s almost no code in this, but I’ve found it very handy when tweaking color schemes, and not having to do this every single time:
Make a change in the file
Navigate mouse to ST2
…then preferences
…then Color Scheme
…then select the one I’m editing
-or-
Hit command-ctrl-r.
Copy below and save “settings_refresh.py” in ST2/Packages/User:
import sublime
import sublime_plugin
class SettingsRefreshCommand(sublime_plugin.TextCommand):
'''This will allow you to refresh/save your settings. Handy
for editing color schemes and seeing the changes quickly.
'''
def run(self, edit):
if not self.view.file_name():
return
sublime.save_settings("Base File.sublime-settings")
sublime.status_message('Settings refreshed.')
def is_enabled(self):
return self.view.file_name() and len(self.view.file_name()) > 0
My user key binding:
{ "keys": "super+ctrl+r"], "command": "settings_refresh" }