-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.wezterm.lua
More file actions
66 lines (55 loc) · 1.41 KB
/
Copy path.wezterm.lua
File metadata and controls
66 lines (55 loc) · 1.41 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
local wezterm = require("wezterm")
local config = {
window_padding = {
left = 0,
right = 0,
top = 1,
bottom = 0,
},
enable_scroll_bar = true,
window_decorations = "RESIZE",
font = wezterm.font("MesloLGS Nerd Font Mono"),
font_size = 16.0,
tab_max_width = 32,
audible_bell = "Disabled",
window_close_confirmation = "NeverPrompt",
use_fancy_tab_bar = false,
tab_bar_at_bottom = false,
window_background_opacity = 0.95,
macos_window_background_blur = 10,
}
config.color_scheme = "Gruvbox dark, soft (base16)"
config.keys = {}
for i = 1, 8 do
table.insert(config.keys, {
key = tostring(i),
mods = "CTRL|ALT",
action = wezterm.action.MoveTab(i - 1),
})
end
for i = 1, 9 do
table.insert(config.keys, {
key = tostring(i),
mods = "CMD",
action = wezterm.action.ActivateTab(i - 1),
})
end
wezterm.on("format-tab-title", function(tab)
local title = tab.active_pane.title
local path_parts = {}
for part in string.gmatch(title, "[^/]+") do
table.insert(path_parts, part)
end
local formatted_title = ""
if #path_parts >= 2 then
formatted_title = path_parts[#path_parts - 1] .. "/" .. path_parts[#path_parts]
elseif #path_parts == 1 then
formatted_title = path_parts[1]
else
formatted_title = title
end
local tab_number = tab.tab_index + 1
local indicator = tab.is_active and "●" or "○"
return string.format(" %s %d. %s ", indicator, tab_number, formatted_title)
end)
return config