Skip to content

Instantly share code, notes, and snippets.

@mkormendy
Last active June 19, 2016 00:39
Show Gist options
  • Select an option

  • Save mkormendy/a32e61e95f7810409d36ca35f17aecc6 to your computer and use it in GitHub Desktop.

Select an option

Save mkormendy/a32e61e95f7810409d36ca35f17aecc6 to your computer and use it in GitHub Desktop.
Sublime Text Plugin with preferences and bindings to toggle auto zoom (resize focused window) feature in the Sublime Text Origami panel management Package.
[
{
"keys": ["super+alt+`"], "command": "toggle_origami_auto_zoom",
}
]
[
{
"origami_auto_zoom_on_focus": 0.75,
"origami_azf_pref": 0.75,
}
]
import sublime
import sublime_plugin
class ToggleOrigamiAutoZoomCommand(sublime_plugin.ApplicationCommand):
def run(self):
settings = sublime.load_settings("Preferences.sublime-settings")
if settings.get("origami_auto_zoom_on_focus", False) != settings.get("origami_azf_pref", False):
origami_auto_zoom_setting = settings.get("origami_azf_pref", False)
else:
origami_auto_zoom_setting = False
settings.set("origami_auto_zoom_on_focus", origami_auto_zoom_setting)
sublime.save_settings("Preferences.sublime-settings")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment