Search code examples
scrollsublimetext3mousewheel

How do I change the mouse wheel scroll speed in Sublime Text 3 or 4+?


The mouse wheel scrolling in Sublime Text 3, on Linux at least, is reaaally sluggish. It scrolls only 3 lines per mouse wheel encoder tick on my mouse, which feels very slow. In Eclipse, however, it scrolls 8 lines per mouse wheel encoder movement, on the same computer and with the same mouse, which feels much more natural.

How do I increase the scroll speed in Sublime Text 3 to scroll faster?

I have tried changing the "scroll_speed" setting in preferences. Ex:

"scroll_speed": 10.0, // default is 1.0

and it made no difference to the mouse wheel scroll speed! It turns out this setting is for the scroll animation speed only, which is animated when you press PgUp or PgDn to scroll.

This is a Q&A-style question I'm posting here because I've searched all over the internet, and found this answer nowhere. After figuring it out myself because I got too tired of the scroll speed in Sublime, I want to share it here to help others.

Related, but not a duplicate:

  1. [not a duplicate because it has absolutely nothing whatsoever to do with mouse wheel scroll speed; this is for PgUp or PgDn scroll animation speed only!] How do I change the speed of text motion when paging up/down in Sublime Text 3?

Solution

  • For Mac and Windows, see if custom mouse scroll settings exist within your operating system.

    For Linux, here's the answer. Tested on Ubuntu 18.04, 20.04, and 22.04 with Sublime Text 3 and 4.

    # create a file called ".imwheelrc" in your home dir
    gedit ~/.imwheelrc
    

    Copy and paste the following into it:

    # For Sublime Text
    "sublime_text"
    None,      Up,   Button4, 3
    None,      Down, Button5, 3
    Control_L, Up,   Control_L|Button4
    Control_L, Down, Control_L|Button5
    Shift_L,   Up,   Shift_L|Button4
    Shift_L,   Down, Shift_L|Button5
    

    The two 3s are what set the mouse wheel scroll speed. They are multipliers against the normal speed, so 3 is 3x faster. In my case, one mouse scroll wheel tick now scrolls 9 lines instead of 3, since I have the up and down speeds set to 3 each above.

    Now install imwheel:

    sudo apt update
    sudo apt install imwheel
    

    Run imwheel -b "4 5" to test your settings. When done testing, run killall imwheel to kill it, then make your edits to ~/.imwheelrc, as desired, and run imwheel -b "4 5" again for more testing.

    Done!

    Sublime Text 3 mouse wheel scroll speed fixed in Linux!


    Note: if you'd like to adjust mouse wheel scroll speed for Google Chrome and Slack too, here's some more entries:

    # For `google-chrome`
    "-chrome"
    None,      Up,   Button4, 3
    None,      Down, Button5, 3
    Control_L, Up,   Control_L|Button4
    Control_L, Down, Control_L|Button5
    Shift_L,   Up,   Shift_L|Button4
    Shift_L,   Down, Shift_L|Button5
    
    # For `slack`
    "slack"
    None,      Up,   Button4, 3
    None,      Down, Button5, 3
    Control_L, Up,   Control_L|Button4
    Control_L, Down, Control_L|Button5
    Shift_L,   Up,   Shift_L|Button4
    Shift_L,   Down, Shift_L|Button5
    
    # For Sublime Text 3
    "sublime_text"
    None,      Up,   Button4, 3
    None,      Down, Button5, 3
    Control_L, Up,   Control_L|Button4
    Control_L, Down, Control_L|Button5
    Shift_L,   Up,   Shift_L|Button4
    Shift_L,   Down, Shift_L|Button5
    

    This is all part of my eRCaGuy_dotfiles project on GitHub. You can download just my "~/.imwheelrc" file here or here (raw), with this command:

    wget https://raw.githubusercontent.com/ElectricRCAircraftGuy/eRCaGuy_dotfiles/master/home/.imwheelrc
    

    References:

    1. My eRCaGuy_dotfiles project on GitHub, and the "~/.imwheelrc" file.
      1. I have my system configured so that Ctrl + Alt + P (P stands for "touch'P'ad" here) toggles my touch pad on and off, and also toggles my imwheel program on and off inversely with the touchpad. See my "touchpad_toggle.sh" script for that in my eRCaGuy_dotfiles project.
      2. I've also configured this to run at boot so that my touchpad is always OFF, and my imwheel always ON to fix mouse wheel scroll speed in these programs each time I turn on my computer.
    2. My answer on AskUbuntu: "Permanently fix Chrome scroll speed"