Skip to content

Instantly share code, notes, and snippets.

@Glaived
Last active November 4, 2016 14:47
Show Gist options
  • Save Glaived/f6da9ae2390dfe10522692a18b5e24ad to your computer and use it in GitHub Desktop.
Save Glaived/f6da9ae2390dfe10522692a18b5e24ad to your computer and use it in GitHub Desktop.
A simple package that lets you toggle between two font size
[
/* You can add shortcut : example for Windows */
{ "keys": ["ctrl+alt+shift+keypad_plus"], "command": "reset_font_size_to_user_defaults" }
/* ... */
]
{
"default_font_size": 9,
"font_size": 9,
"spectator_font_size": 12,
/* ... */
}
# Fork from: http://larsnordeide.com/2013/improve-sublime-text-2-part-1.html
# Store the following command in a file reset_font_size_command.py in you User package folder.
import sublime
import sublime_plugin
class ResetFontSizeToUserDefaultsCommand(sublime_plugin.ApplicationCommand):
def run(self):
s = sublime.load_settings('Preferences.sublime-settings')
if s.has('default_font_size') & s.has('spectator_font_size'):
if s.get('font_size') == s.get('default_font_size'):
s.set('font_size', s.get('spectator_font_size'))
else:
s.set('font_size', s.get('default_font_size'))
sublime.save_settings('Preferences.sublime-settings')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment