The command that does this is reset_font_size
, which is in Default/font.py
. As you mentioned, by default it erases the customized setting from your user preferences, which takes it back to the default given in the default settings. You can modify this behaviour as you see fit, which is one of the great things about Sublime.
For example, you can install PackageResourceViewer and OverrideAudit, and then follow these steps:
- Select
PackageResourceViewer: Open Resource
from the command palette
- Select
Default
- Select
font.py
- Replace the
ResetFontSizeCommand
code at the end of the file with the code below
- Save the file and close it
- Add a setting to your
Preferences.sublime-settings
named default_font_size
and set it to the font size you want to use by default
Optionally you can replace the default font size of 12
in this code with a setting of your choosing; this sets what the font size gets set to when the new setting is not present.
class ResetFontSizeCommand(sublime_plugin.ApplicationCommand):
def run(self):
s = sublime.load_settings("Preferences.sublime-settings")
default = s.get("default_font_size", 12)
s.set("font_size", default)
sublime.save_settings("Preferences.sublime-settings")
Now the menu command will replace the settings in your user preferences with your configured default. The install of OverrideAudit
will warn you if future updates to Sublime make changes to the Default/font.py
file that you modified, so that you can incorporate any new changes.
Note that this command will have no effect if you have a syntax specific setting for font size (e.g. make the font in html
files smaller than other files), because in those cases the font size isn’t coming from the preferences. The potential complications of the interactions of various settings is probably one of the reasons this works the way it does by default.