Skip to content

Instantly share code, notes, and snippets.

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'))

This comment has been minimized.

Copy link

@mcardle mcardle commented Feb 16, 2015

You have a typo in the python name:

Should be:

// Ulrik McArdle


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