Last active
February 4, 2022 05:22
-
-
Save vitaLee/5013169 to your computer and use it in GitHub Desktop.
[Sublime Text] Enable resetting font size to a predefined default value.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ "keys": ["super+0"], "command": "reset_font_size_to_user_defaults" } | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"default_font_size": 10 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You have a typo in the python name:
reset_font_size_commad.py
Should be:
reset_font_size_command.py
// Ulrik McArdle