local wez = require 'wezterm' local bindings = { -- Wheel: scroll 1 line per tick { event = { Down = { streak = 1, button = { WheelUp = 1 } } }, mods = 'NONE', action = wez.action.ScrollByLine(-1), }, { event = { Down = { streak = 1, button = { WheelDown = 1 } } }, mods = 'NONE', action = wez.action.ScrollByLine(1), }, -- SHIFT+Wheel: scroll normal-screen scrollback 5 lines { event = { Down = { streak = 1, button = { WheelUp = 1 } } }, mods = 'SHIFT', alt_screen = false, action = wez.action.ScrollByLine(-5), }, { event = { Down = { streak = 1, button = { WheelDown = 1 } } }, mods = 'SHIFT', alt_screen = false, action = wez.action.ScrollByLine(5), }, -- SHIFT+Wheel: send 5 line-scroll keys to mouse-aware alternate-screen apps { event = { Down = { streak = 1, button = { WheelUp = 1 } } }, mods = 'SHIFT', alt_screen = true, mouse_reporting = true, action = wez.action.Multiple { wez.action.SendKey { key = 'PageUp', }, wez.action.SendKey { key = 'PageUp', }, wez.action.SendKey { key = 'PageUp', }, wez.action.SendKey { key = 'PageUp', }, wez.action.SendKey { key = 'PageUp', }, }, }, { event = { Down = { streak = 1, button = { WheelDown = 1 } } }, mods = 'SHIFT', alt_screen = true, mouse_reporting = true, action = wez.action.Multiple { wez.action.SendKey { key = 'PageDown', }, wez.action.SendKey { key = 'PageDown', }, wez.action.SendKey { key = 'PageDown', }, wez.action.SendKey { key = 'PageDown', }, wez.action.SendKey { key = 'PageDown', }, }, }, { event = { Down = { streak = 4, button = 'Left', }, }, action = wez.action.SelectTextAtMouseCursor 'SemanticZone', mods = 'NONE', }, -- CTRL+Wheel: font size { event = { Down = { streak = 1, button = { WheelUp = 1 }, }, }, mods = 'CTRL', action = wez.action.IncreaseFontSize, }, { event = { Down = { streak = 1, button = { WheelDown = 1 }, }, }, mods = 'CTRL', action = wez.action.DecreaseFontSize, }, } return function ( cfg ) cfg.mouse_bindings = bindings end