1

I started using Sublime Text a few weeks ago and I find it irritating that the text zooms in or out when I'm trying to type something or navigate. This is because the base of my two thumbs come in contact with the touch pad. Moreover, there isn't a Ctrl+* or Ctrl+0 shortcut to reset the font size. (Font size and zoom mean the same thing in Sublime Text.)

I couldn't find anything in the Preferences file about this. The Key Bindings file contains

{ "keys": ["ctrl++"], "command": "increase_font_size" },
    { "keys": ["ctrl+="], "command": "increase_font_size" },
    { "keys": ["ctrl+keypad_plus"], "command": "increase_font_size" },
    { "keys": ["ctrl+-"], "command": "decrease_font_size" },
    { "keys": ["ctrl+keypad_minus"], "command": "decrease_font_size" },

    { "keys": ["ctrl+equals"], "command": "increase_font_size" },
    { "keys": ["ctrl+shift+equals"], "command": "decrease_font_size" },
    { "keys": ["ctrl+shift+keypad_plus"], "command": "decrease_font_size" },
arunkumaraqm
  • 337
  • 1
  • 13

1 Answers1

1

You can always define your own key bindings to override the existing ones provided by ST by default. If you want a key binding to reset the font size to the default one of 10, you can do that (the key combination/sequence can be anything of your choice) :-

{
    "keys": ["ctrl+shift+f"],
    "command": "reset_font_size",
}

This will reset the font size when the said binding is pressed. If you want to disable any of the default keybindings provided, you can do that as well. Either you need to bind it to another command or use something called the noop (No operation) command. Suppose, you don't want ctrl + = to increase the font size (or you just want to disable it all together), then you just have to paste the following in your user keymap file.

{
    "keys": ["ctrl+="],
    "command": "noop",
}

Note : To create your own keymap file, you will need to create a .sublime-keymap file (The name can be anything, by convention it's named as Default) in the User directory. Any key bindings now defined in this file will override the ones existing in the default keymap files.

Ashwin Shenoy
  • 661
  • 5
  • 8
  • But this isn't what I was asking for. – arunkumaraqm Mar 30 '20 at 15:53
  • What exactly is the problem, then ? If suppose something is causing the font size to increase or decrease without your knowledge then I recommend opening the console (by pressing ctrl + ` & typing ```sublime.log_input(True)``` & ```sublime.log_commands(True)``` so you can know what key binding is causing the font size to increase) – Ashwin Shenoy Mar 30 '20 at 15:59
  • Will use that for any issues in the future. My question has been marked duplicate and the original page provides a solution to my question. – arunkumaraqm Mar 31 '20 at 15:03