-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
default.lua
86 lines (77 loc) · 2.91 KB
/
default.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
---@module "mappings.default"
---@author sravioli
---@license GNU-GPLv3
---@diagnostic disable-next-line: undefined-field
local act = require("wezterm").action
local key = require("utils.fn").key
local Config = {}
Config.disable_default_key_bindings = true
Config.leader = { key = "Space", mods = "CTRL", timeout_milliseconds = 1000 }
local mappings = {
{ "<C-Tab>", act.ActivateTabRelative(1), "next tab" },
{ "<C-S-Tab>", act.ActivateTabRelative(-1), "prev tab" },
{ "<M-CR>", act.ToggleFullScreen, "fullscreen" },
{ "<C-S-c>", act.CopyTo "Clipboard", "copy" },
{ "<C-S-v>", act.PasteFrom "Clipboard", "paste" },
{ "<C-S-f>", act.Search "CurrentSelectionOrEmptyString", "search" },
{ "<C-S-k>", act.ClearScrollback "ScrollbackOnly", "clear scrollback" },
{ "<C-S-l>", act.ShowDebugOverlay, "debug overlay" },
{ "<C-S-n>", act.SpawnWindow, "new window" },
{ "<C-S-p>", act.ActivateCommandPalette, "command palette" },
{ "<C-S-r>", act.ReloadConfiguration, "reload config" },
{ "<C-S-t>", act.SpawnTab "CurrentPaneDomain", "new pane" },
{
"<C-S-u>",
act.CharSelect {
copy_on_select = true,
copy_to = "ClipboardAndPrimarySelection",
},
"char select",
},
{ "<C-S-w>", act.CloseCurrentTab { confirm = true }, "close tab" },
{ "<C-S-z>", act.TogglePaneZoomState, "toggle zoom" },
{ "<PageUp>", act.ScrollByPage(-1), "" },
{ "<PageDown>", act.ScrollByPage(1), "" },
{ "<C-S-Insert>", act.PasteFrom "PrimarySelection", "" },
{ "<C-Insert>", act.CopyTo "PrimarySelection", "" },
{ "<C-S-Space>", act.QuickSelect, "quick select" },
{
"<S-M-t>",
act.ShowLauncherArgs {
title = " Search:",
flags = "FUZZY|LAUNCH_MENU_ITEMS|DOMAINS",
},
"new window",
},
---quick split and nav
{ '<C-S-">', act.SplitHorizontal { domain = "CurrentPaneDomain" }, "vsplit" },
{ "<C-S-%>", act.SplitVertical { domain = "CurrentPaneDomain" }, "hsplit" },
{ "<C-M-h>", act.ActivatePaneDirection "Left", "move left" },
{ "<C-M-j>", act.ActivatePaneDirection "Down", "mode down" },
{ "<C-M-k>", act.ActivatePaneDirection "Up", "move up" },
{ "<C-M-l>", act.ActivatePaneDirection "Right", "move right" },
---key tables
{ "<leader>h", act.ActivateKeyTable { name = "help_mode", one_shot = true }, "help" },
{
"<leader>w",
act.ActivateKeyTable { name = "window_mode", one_shot = false },
"window mode",
},
{
"<leader>f",
act.ActivateKeyTable { name = "font_mode", one_shot = false },
"font mode",
},
{ "<leader>c", act.ActivateCopyMode, "copy mode" },
{ "<leader>s", act.Search "CurrentSelectionOrEmptyString", "search mode" },
{ "<leader>p", act.ActivateKeyTable { name = "pick_mode" }, "pick mode" },
}
for i = 1, 24 do
mappings[#mappings + 1] =
{ "<S-F" .. i .. ">", act.ActivateTab(i - 1), "activate tab " .. i }
end
Config.keys = {}
for _, map_tbl in ipairs(mappings) do
key.map(map_tbl[1], map_tbl[2], Config.keys)
end
return Config