Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[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")
@mcardle

This comment has been minimized.

Copy link

@mcardle mcardle commented Feb 16, 2015

You have a typo in the python name:
reset_font_size_commad.py

Should be:
reset_font_size_command.py

// Ulrik McArdle

@SusanthCom

This comment has been minimized.

Copy link

@SusanthCom SusanthCom commented Sep 15, 2017

@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