-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkeymaps.lua
More file actions
142 lines (118 loc) · 5.59 KB
/
Copy pathkeymaps.lua
File metadata and controls
142 lines (118 loc) · 5.59 KB
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
-- Keymaps --
local wez = require("wezterm")
local act = require("wezterm").action
local mux = require("wezterm").mux
----------------------------------
local M = {}
function M.apply_to_config(config)
config.disable_default_key_bindings = true
--config.enable_kitty_keyboard = true
--When set to true, each key event will be logged by the GUI layer as an INFO level log message on the stderr stream from wezterm. You will typically need to launch wezterm directly from another terminal to see this logging.
--help figuring out how keys are being decoded on your system, or for discovering the system-dependent "raw" key code values.
config.debug_key_events = false
config.keys = {
-- ALTGR+q
{ key = "@", mods = "CTRL", action = act.QuitApplication },
-- Reload config -- ctrl + altgr + r
{ key = "¶", mods = "CTRL", action = act.ReloadConfiguration }, --TOdo add lecho restarted
-- Font size adjustments
{ key = "+", mods = "CTRL", action = act.IncreaseFontSize },
{ key = "-", mods = "CTRL", action = act.DecreaseFontSize },
-- { key = "0", mods = "CTRL", action = act.ResetFontSize },
-- Clipboard actions
{
key = 'c',
mods = 'CTRL',
action = wez.action_callback(function(window, pane)
if pane:is_alt_screen_active() then -- Is in some TUI
window:perform_action(act.SendKey({key='c', mods='CTRL'}), pane)
else
window:perform_action(act.CopyTo("ClipboardAndPrimarySelection"), pane)
end
end),
-- alt_screen = false,
},
{
key = "v",
mods = "CTRL",
action = wez.action_callback(function(window, pane)
if pane:is_alt_screen_active() then -- Is in some TUI
window:perform_action(act.SendKey({ key = "v", mods = "CTRL" }), pane)
else
window:perform_action(act.PasteFrom('Clipboard'), pane)
end
end),
-- alt_screen = false,
},
--{key="Backspace", mods="CTRL", action=wezterm.action{SendString="\x1b[78~"} },
-- to disambiguate from ^H
{ key="Backspace", mods="CTRL", action = act.SendKey{ key = "Backspace", mods ="SHIFT|ALT"} },
{
key = "PageUp",
mods = "NONE",
action = wez.action_callback(function(window, pane)
if pane:is_alt_screen_active() then
window:perform_action(act.SendKey({ key = "PageUp", mods = "NONE" }), pane)
else
window:perform_action(act.ScrollByPage(-1), pane)
end
end),
},
{
key = "PageDown",
mods = "NONE",
action = wez.action_callback(function(window, pane)
if pane:is_alt_screen_active() then
window:perform_action(act.SendKey({key = "PageDown", mods = "NONE"}), pane)
else
window:perform_action(act.ScrollByPage(1), pane)
end
end),
},
-- interupt kill proc
{ key = "¢", mods = "CTRL", action = act.SendKey({ key = "c", mods = "CTRL" }) },
-- ## Tabs
{
key = "w",
mods = "CTRL",
action = wez.action_callback(function(window, pane)
if pane:is_alt_screen_active() then
window:perform_action(act.SendKey({key = "w", mods = "CTRL"}), pane)
else
local mux_window = window:mux_window()
local tabs = mux_window:tabs()
if #tabs > 1 then
window:perform_action(act.CloseCurrentTab({confirm = false}), pane)
end
end
end),
},
{
key = "ł",
mods = "CTRL",
action = act.CloseCurrentTab({confirm = false}),
},
{ key = "ŧ", mods = "CTRL", action = act.SpawnTab("CurrentPaneDomain") },
{ key = "Tab", mods = "CTRL|ALT", action = act.ActivateTabRelative(1) }, --Cycle tabs
-- ## Panes
-- { key = "N", mods = "SHIFT|CTRL", action = act.SpawnWindow },
{ key = "„", mods = "CTRL|ALT", action = act.SplitHorizontal({ domain = "CurrentPaneDomain" }) },
{ key = "ħ", mods = "CTRL|ALT", action = act.SplitVertical({ domain = "CurrentPaneDomain" }) },
{ key = "ł", mods = "CTRL|ALT", action = act.CloseCurrentPane({ confirm = false }) },
-- Pane navigation
-- { key = "j", mods = "CTRL", action = act.ActivatePaneDirection("Down") },
-- { key = "k", mods = "CTRL", action = act.ActivatePaneDirection("Up") },
-- { key = "h", mods = "CTRL", action = act.ActivatePaneDirection("Left") },
-- { key = "l", mods = "CTRL", action = act.ActivatePaneDirection("Right") },
-- Move focus between panes with arrow keys
-- { key = "LeftArrow", mods = "SHIFT|CTRL", action = act.ActivatePaneDirection("Left") },
-- { key = "RightArrow", mods = "SHIFT|CTRL", action = act.ActivatePaneDirection("Right") },
-- { key = "UpArrow", mods = "SHIFT|CTRL", action = act.ActivatePaneDirection("Up") },
-- { key = "DownArrow", mods = "SHIFT|CTRL", action = act.ActivatePaneDirection("Down") },
-- Debug
{ key = '*', mods = 'CTRL|SHIFT', action = wez.action.ShowDebugOverlay},
{ key = "ù", mods = "CTRL|SHIFT", action = wez.action.ShowLauncher },
}--config keys
end
--------
return M