Last active
August 29, 2015 14:03
toggle color scheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ "keys": ["ctrl+super+h"], "command": "toggle_color_scheme", | |
"args": { | |
"dark_color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme", | |
} | |
} | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sublime, sublime_plugin | |
class ToggleColorSchemeCommand(sublime_plugin.TextCommand): | |
def run(self, edit, **args): | |
light_scheme = "Packages/User/Solarized (Light) (SL).tmTheme" | |
dark_scheme = args["dark_color_scheme"] | |
settings = sublime.load_settings('Preferences.sublime-settings') | |
current_scheme = settings.get('color_scheme') | |
if current_scheme == light_scheme: | |
settings.set('color_scheme', dark_scheme) | |
else: | |
settings.set('color_scheme', light_scheme) | |
sublime.save_settings('Preferences.sublime-settings') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment