-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkeymaps.lua
94 lines (84 loc) · 3.38 KB
/
keymaps.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
87
88
89
90
91
92
93
94
local wezterm = require("wezterm")
local act = wezterm.action
local split = require("plugins/nvim-smart-splits")
local M = {}
M.keys = {
-- Send C-a when pressing C-a twice
{ key = "a", mods = "LEADER|CTRL", action = act.SendKey({ key = "a", mods = "CTRL" }) },
{ key = "c", mods = "LEADER", action = act.ActivateCopyMode },
{ key = "phys:Space", mods = "LEADER", action = act.ActivateCommandPalette },
-- Pane keybindings
-- move between split panes
split.nav("move", "h"),
split.nav("move", "j"),
split.nav("move", "k"),
split.nav("move", "l"),
{ key = "s", mods = "LEADER", action = act.SplitVertical({ domain = "CurrentPaneDomain" }) },
{ key = "v", mods = "LEADER", action = act.SplitHorizontal({ domain = "CurrentPaneDomain" }) },
{ key = "h", mods = "LEADER", action = act.ActivatePaneDirection("Left") },
{ key = "j", mods = "LEADER", action = act.ActivatePaneDirection("Down") },
{ key = "k", mods = "LEADER", action = act.ActivatePaneDirection("Up") },
{ key = "l", mods = "LEADER", action = act.ActivatePaneDirection("Right") },
{ key = "q", mods = "LEADER", action = act.CloseCurrentPane({ confirm = true }) },
{ key = "f", mods = "LEADER", action = act.TogglePaneZoomState },
{ key = "o", mods = "LEADER", action = act.RotatePanes("Clockwise") },
-- resize panes
split.nav("resize", "h"),
split.nav("resize", "j"),
split.nav("resize", "k"),
split.nav("resize", "l"),
-- resize pane mode
{
key = "r",
mods = "LEADER",
action = act.ActivateKeyTable({ name = "resize_pane", one_shot = false }),
},
-- Tab keybindings
{ key = "t", mods = "LEADER", action = act.SpawnTab("CurrentPaneDomain") },
{ key = "[", mods = "LEADER", action = act.ActivateTabRelative(-1) },
{ key = "]", mods = "LEADER", action = act.ActivateTabRelative(1) },
{ key = "n", mods = "LEADER", action = act.ShowTabNavigator },
{
key = "e",
mods = "LEADER",
action = act.PromptInputLine({
description = wezterm.format({
{ Attribute = { Intensity = "Bold" } },
{ Foreground = { Color = "#f38ba8" } },
{ Text = "Renaming Tab Title...:" },
}),
action = wezterm.action_callback(function(window, _, line)
if line then
window:active_tab():set_title(line)
end
end),
}),
},
-- Key table for moving tabs around
{ key = "m", mods = "LEADER", action = act.ActivateKeyTable({ name = "move_tab", one_shot = false }) },
-- Or shortcuts to move tab w/o move_tab table. SHIFT is for when caps lock is on
{ key = "{", mods = "LEADER|SHIFT", action = act.MoveTabRelative(-1) },
{ key = "}", mods = "LEADER|SHIFT", action = act.MoveTabRelative(1) },
-- Lastly, workspace
{ key = "w", mods = "LEADER", action = act.ShowLauncherArgs({ flags = "FUZZY|WORKSPACES" }) },
}
-- Represents the keymaps for modes
M.key_tables = {
resize_pane = {
{ key = "h", action = act.AdjustPaneSize({ "Left", 1 }) },
{ key = "j", action = act.AdjustPaneSize({ "Down", 1 }) },
{ key = "k", action = act.AdjustPaneSize({ "Up", 1 }) },
{ key = "l", action = act.AdjustPaneSize({ "Right", 1 }) },
{ key = "Escape", action = "PopKeyTable" },
{ key = "Enter", action = "PopKeyTable" },
},
move_tab = {
{ key = "h", action = act.MoveTabRelative(-1) },
{ key = "j", action = act.MoveTabRelative(-1) },
{ key = "k", action = act.MoveTabRelative(1) },
{ key = "l", action = act.MoveTabRelative(1) },
{ key = "Escape", action = "PopKeyTable" },
{ key = "Enter", action = "PopKeyTable" },
},
}
return M