Skip to content

Instantly share code, notes, and snippets.

@vitaLee
Last active February 4, 2022 05:22
Show Gist options
  • Save vitaLee/5013169 to your computer and use it in GitHub Desktop.
Save vitaLee/5013169 to your computer and use it in GitHub Desktop.
[Sublime Text] Enable resetting font size to a predefined default value.
[
{ "keys": ["super+0"], "command": "reset_font_size_to_user_defaults" }
]
{
"default_font_size": 10
}
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.set('font_size', s.get('default_font_size'))
sublime.save_settings("Preferences.sublime-settings")
@SusanthCom
Copy link

@mcardle that file name spelling mistake you mentioned; helped me 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment