-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwezterm.lua
214 lines (201 loc) · 4.85 KB
/
wezterm.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
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
local wezterm = require 'wezterm'
local act = wezterm.action
local config = wezterm.config_builder()
-- Meta
config.automatically_reload_config = true
-- Rendering
config.freetype_load_flags = 'NO_HINTING'
config.freetype_load_target = "Light"
config.front_end = "WebGpu"
config.max_fps = 144
config.webgpu_preferred_adapter = {
backend = 'Metal',
device_type= "IntegratedGpu",
name= "Apple M3 Pro",
}
-- Window
config.window_decorations = "RESIZE|MACOS_FORCE_DISABLE_SHADOW"
config.window_background_opacity = 0.975
config.macos_window_background_blur = 20
-- Layout
config.initial_rows = 50
config.initial_cols = 200
-- Tabs
config.use_fancy_tab_bar = false
config.enable_tab_bar = true
config.tab_bar_at_bottom = true
config.tab_max_width = 40
config.hide_tab_bar_if_only_one_tab = false
config.show_new_tab_button_in_tab_bar = false
config.inactive_pane_hsb = {
saturation = 0.8,
brightness = 0.8,
}
-- Fonts
config.harfbuzz_features = { 'zero', 'calt=1', 'clig=1', 'liga=1' }
config.font = wezterm.font('Hasklig', { weight = 'Medium' })
config.font_size = 14.5
config.line_height = 1.15
config.font_rules = {
{
italic = false,
intensity = 'Half',
font = wezterm.font('Hasklig', { weight = 'Regular' })
},
{
italic = false,
intensity = 'Normal',
font = wezterm.font('Hasklig', { weight = 'Medium' })
},
{
italic = false,
intensity = 'Bold',
font = wezterm.font('Hasklig', { weight = 'DemiBold' })
},
{
italic = true,
intensity = 'Normal',
font = wezterm.font('Hasklig', { weight = 'Medium' })
}
}
-- Cursor
config.cursor_blink_ease_in = 'Linear'
config.cursor_blink_ease_out = 'Linear'
config.cursor_blink_rate = 800
-- Colours
config.color_scheme_dirs = { '$HOME/.config/wezterm/colors' }
config.color_scheme = 'nerdyman'
-- Mouse bindings
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',
},
-- and make CTRL-Click open hyperlinks
{
event = { Up = { streak = 1, button = 'Left' } },
mods = 'CTRL',
action = act.OpenLinkAtMouseCursor,
},
}
-- Key bindings
config.enable_kitty_keyboard = true
config.leader = { key = 'a', mods = 'CTRL' }
config.keys = {
{
key = 'H',
mods = 'LEADER',
action = act.AdjustPaneSize { 'Left', 5 },
},
{
key = 'J',
mods = 'LEADER',
action = act.AdjustPaneSize { 'Down', 5 },
},
{
key = 'K',
mods = 'LEADER',
action = act.AdjustPaneSize { 'Up', 5 }
},
{
key = 'L',
mods = 'LEADER',
action = act.AdjustPaneSize { 'Right', 5 },
},
-- Make cmd arrow left go to start of the line
{
key = 'LeftArrow',
mods = 'CMD',
action = wezterm.action { SendString = "\x1bOH" },
},
-- Make cmd arrow right go to start of line
{
key = 'RightArrow',
mods = 'CMD',
action = wezterm.action { SendString = "\x1bOF" },
},
-- Make Option-Left equivalent to Alt-b which many line editors interpret as backward-word
{
key = "LeftArrow",
mods = "OPT",
action = act{ SendString = "\x1bb" }
},
-- Make Option-Right equivalent to Alt-f; forward-word
{
key = "RightArrow",
mods = "OPT",
action = act{ SendString = "\x1bf" }
},
-- Set tab title
{
key = 'E',
mods = 'CTRL|SHIFT',
action = act.PromptInputLine {
description = 'Set tab name:',
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:active_tab():set_title(line)
end
end),
},
},
-- Open new pane
{
key = 'Enter',
mods = 'SHIFT|CTRL',
action = act.SplitVertical{ domain = 'CurrentPaneDomain' },
},
{
key = 'Enter',
mods = 'SHIFT',
action = act.SplitHorizontal{ domain = 'CurrentPaneDomain' },
},
{
key = 'F1',
action = act.TogglePaneZoomState,
},
-- Cycle pane forward
{
key = '}',
mods = 'SHIFT|CTRL',
action = act{ActivatePaneDirection="Next"},
},
-- Cycle pane backwards
{
key = '{',
mods = 'SHIFT|CTRL',
action = act{ActivatePaneDirection="Prev"},
},
-- Cycle tab forward
{
key = 'RightArrow',
mods = 'SHIFT|CTRL',
action = act{ActivateTabRelative=1},
},
-- Cycle tab backwards
{
key = 'LeftArrow',
mods = 'SHIFT|CTRL',
action = act{ActivateTabRelative=-1},
},
-- Quit tab
{
key = 'Q',
mods = 'SHIFT|CTRL',
action = act{CloseCurrentTab={confirm=false}},
},
-- Show command menu
{
key = 'P',
mods = 'SHIFT|CTRL',
action = act.ActivateCommandPalette,
},
}
return config
-- vim: set expandtab shiftwidth=2 softtabstop=2: