Search code examples
sublimetext3

Enable mouse wheel to change tabs in Sublime Text 3


I'm trying to enable tab switching using the mouse wheel in Sublime Text 3.

I added this configurations to my User settings:

"enable_tab_scrolling": false,
"mouse_wheel_switches_tabs": true,

Also tried different order and values but none is working.

I always restart Sublime after changing my settings.

Anyone got this working?


Solution

  • "mouse_wheel_switches_tabs": true, only works if the following conditions have been met:

    • the mouse pointer is over the tab bar while using the scroll wheel
    • your theme supports it in conjunction with your preferences
      • try with the Default theme
      • tweak your theme to support it

    The Default theme contains the following rule to enable this functionality:

    {
        "class": "tabset_control",
        "settings": ["mouse_wheel_switches_tabs", "!enable_tab_scrolling"],
        "mouse_wheel_switch": true
    },
    

    Note that it doesn't work with "enable_tab_scrolling": true, so you did the right thing to set it to false.

    You could add this rule to whichever theme you are using by creating a file with the same name as the .sublime-theme you are using, and pasting in the rule surrounded by square brackets - it needs to be a valid JSON array.

    More information on how themes work can be found in the official docs.