Sublime Forum

Can't reset zoom level

#1

I’d like to point out na inconsistency between text zooming in a browser (Chrome or Firefox) vs Sublime Text.

In a browser you can use these shortcuts:

Cmd + zoom in
Cmd - zoom out
Cmd 0 - reset zoom level

Sublime supports zooming (in and out), but you can’t reset zoom level. Is this a defect?

1 Like

#2

https://gist.github.com/vitaLee/5013169

add this to your keybindings

{ "keys": "super+0"], "command": "reset_font_size_to_user_defaults" }

this to your settings

"default_font_size": 10

and create new command in file reset_font_size_commad.py under your user folder

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

that’s it :smile:

0 Likes

#3

Add this to your key bindings:

{ "keys": "super+0"], "command": "reset_font_size" }
0 Likes

#4

It would be easier if I didn’t have to do this :bulb:

0 Likes