Repository navigation
Expand file tree
/
Copy pathsplits-keybindings.lua
More file actions
90 lines (81 loc) · 3.15 KB
/
Copy pathsplits-keybindings.lua
File metadata and controls
90 lines (81 loc) · 3.15 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
local wezterm = require("wezterm")
local act = wezterm.action
-- This is the module table that we will export
local module = {}
local function split_pane(direction)
return act.SplitPane({
direction = direction,
size = { Percent = 50 },
})
end
wezterm.on("update-right-status", function(window)
window:set_right_status(window:active_workspace())
end)
function module.apply_to_config(config)
config.keys = {
-- Toggle pane being the full screen
{ key = "Enter", mods = "SUPER|SHIFT", action = act.TogglePaneZoomState },
-- Pane Splits
{ key = "k", mods = "SUPER|ALT", action = split_pane("Up") },
{ key = "j", mods = "SUPER|ALT", action = split_pane("Down") },
{ key = "h", mods = "SUPER|ALT", action = split_pane("Left") },
{ key = "l", mods = "SUPER|ALT", action = split_pane("Right") },
-- Pane Split Navigating
{ key = "k", mods = "SUPER|SHIFT", action = act.ActivatePaneDirection("Up") },
{ key = "j", mods = "SUPER|SHIFT", action = act.ActivatePaneDirection("Down") },
{ key = "h", mods = "SUPER|SHIFT", action = act.ActivatePaneDirection("Left") },
{ key = "l", mods = "SUPER|SHIFT", action = act.ActivatePaneDirection("Right") },
-- Pane Split Adjust Size
{ key = "k", mods = "SUPER|SHIFT|ALT", action = act.AdjustPaneSize({ "Up", 5 }) },
{ key = "j", mods = "SUPER|SHIFT|ALT", action = act.AdjustPaneSize({ "Down", 5 }) },
{ key = "h", mods = "SUPER|SHIFT|ALT", action = act.AdjustPaneSize({ "Left", 5 }) },
{ key = "l", mods = "SUPER|SHIFT|ALT", action = act.AdjustPaneSize({ "Right", 5 }) },
-- Window Sessions
-- Switch to the default workspace
{
key = "d",
mods = "SUPER|SHIFT",
action = act.SwitchToWorkspace({
name = "default",
}),
},
-- Create a new workspace with a random name and switch to it
{ key = "r", mods = "SUPER|SHIFT", action = act.SwitchToWorkspace },
-- Show the launcher in fuzzy selection mode and have it list all workspaces
-- and allow activating one.
{
key = "f",
mods = "SUPER|SHIFT",
action = act.ShowLauncherArgs({
flags = "FUZZY|WORKSPACES",
}),
},
-- Prompt for a name to use for a new workspace and switch to it.
{
key = "n",
mods = "SUPER|SHIFT",
action = act.PromptInputLine({
description = wezterm.format({
{ Attribute = { Intensity = "Bold" } },
-- { Foreground = { AnsiColor = "Fuchsia" } },
{ Text = "Enter name for new workspace" },
}),
action = wezterm.action_callback(function(window, pane, line)
-- line will be `nil` if they hit escape without entering anything
-- An empty string if they just hit enter
-- Or the actual line of text they wrote
if line then
window:perform_action(
act.SwitchToWorkspace({
name = line,
}),
pane
)
end
end),
}),
},
}
end
-- return our module table
return module