Home Download Buy Blog Forum Support

settings_refresh: handy for tweaking themes & color schemes

settings_refresh: handy for tweaking themes & color schemes

Postby ehamiter on Wed Sep 07, 2011 4:32 pm

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


Hit command-ctrl-r.

Copy below and save "settings_refresh.py" in ST2/Packages/User:
Code: Select all
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():

        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:
Code: Select all
{ "keys": ["super+ctrl+r"], "command": "settings_refresh" }
Posts: 67
Joined: Wed Apr 27, 2011 2:42 am

Return to Plugin Announcements

Who is online

Users browsing this forum: No registered users and 9 guests