forked from chaozwn/wezterm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmousebinds.lua
36 lines (32 loc) · 925 Bytes
/
mousebinds.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
local wezterm = require "wezterm"
local act = wezterm.action
local M = {}
-- https://www.baidu.com
function M.apply_to_config(config)
config.mouse_bindings = {
-- Change the default click behavior so that it only selects
-- text and doesn't open hyperlinks
{
event = { Up = { streak = 1, button = "Left" } },
mods = "NONE",
action = act.CompleteSelection "ClipboardAndPrimarySelection",
},
{
event = { Down = { streak = 1, button = "Right" } },
mods = "NONE",
action = act { PasteFrom = "Clipboard" },
},
-- and make CTRL-Click open hyperlinks
{
event = { Up = { streak = 1, button = "Left" } },
mods = "CTRL",
action = act.OpenLinkAtMouseCursor,
},
{
event = { Down = { streak = 3, button = "Left" } },
action = wezterm.action.SelectTextAtMouseCursor "SemanticZone",
mods = "NONE",
},
}
end
return M