In Sublime text, how do you disable increase/decrease font size with ctrl and mouse wheel?

43

13

With Sublime Text, is it possible to disable increase/decrease font size when using control and mouse? I found the key bindings for ctrl and +/-:

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

If I wanted to disable those, I could set the command to 'null', but how do you disable increase_font_size and decrease_font_size when using ctrl and mouse wheel? I'm on ubuntu if it is an OS setting.

d_rail

Posted 2012-09-10T19:35:08.207

Reputation: 2 809

Answers

51

Found help on the sublime forums, should have looked there first. But I will post a solution in case anyone wants to do the same.

I am using linux, but answer similar for windows. Copy 'Default (Linux).sublime-mousemap' from '~/.config/sublime-text-2/Packages/Default' into '...Packages/User':

cd ~/.config/sublime-text-2/
cp Packages/Default\ (Linux).sublime-mousemap Packages/User/

Remove everything except font settings and change the command to null:

[
  // Change font size with ctrl+scroll wheel
  { "button": "scroll_down", "modifiers": ["ctrl"], "command": "null" },
  { "button": "scroll_up", "modifiers": ["ctrl"], "command": "null" }
]

Copy it into your User folder so settings don't reset after an update.

Update for Sublime Text 3: This works with sublime text 3 as well, you'll just have to create the file manually subl ~/.config/sublime-text-3/Packages/User/Default (Linux).sublime-mousemap

d_rail

Posted 2012-09-10T19:35:08.207

Reputation: 2 809

3This works with sublime text 3 as well, you'll just have to create the file manually subl ~/.config/sublime-text-3/Packages/User/Default (Linux).sublime-mousemap – Thomas Jensen – 2014-07-22T12:36:11.743

4For windows because this question comes up as #1 in google. Create a file located at C:\Users\Michael J. Calkins\AppData\Roaming\Sublime Text 3\Packages\User\Default (Windows).sublime-mousemap and add the commands in the above answer then restart sublime. – Michael J. Calkins – 2015-03-11T23:09:09.020

8

Linux:

vim ~/.config/sublime-text-2/Packages/User/"Default (Linux).sublime-mousemap"

Set it to:

[
  // Change font size with ctrl+scroll wheel
  { "button": "scroll_down", "modifiers": ["ctrl"], "command": "null" },
  { "button": "scroll_up", "modifiers": ["ctrl"], "command": "null" }
]

Thanks to d_rail for the answer, just wanted to make it easier to do quickly.

Brad

Posted 2012-09-10T19:35:08.207

Reputation: 203

5

On sublime 3, linux:

cat <<EOF>~/.config/sublime-text-3/Packages/User/"Default (Linux).sublime-mousemap"
[
  // Change font size with ctrl+scroll wheel
  { "button": "scroll_down", "modifiers": ["ctrl"], "command": "null" },
  { "button": "scroll_up", "modifiers": ["ctrl"], "command": "null" }
]
EOF

Thanks to d_rail for the answer, just making it easier to do it quickly on sublime 3 :-)

Hugh Perkins

Posted 2012-09-10T19:35:08.207

Reputation: 531