-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot_wezterm.lua
60 lines (50 loc) · 1.29 KB
/
dot_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
local wezterm = require 'wezterm';
local keys = {
}
table.insert(keys, {
mods="CTRL",
key="Tab",
action=wezterm.action{ActivateTabRelative=1},
})
function basename(s)
return string.gsub(s, ".*[/\\](.*)", "%1")
end
function dirname(s)
return string.gsub(s, ".*[/\\](.+)", "%1")
end
function wd_display(s)
return dirname(string.gsub(s, "file://.*:/Users/gweber/(.*)", "%1"))
end
function user_display(s)
return string.gsub(s, "gweber@(.*)", "%1")
end
function title_display(s)
return host_display(user_display(s))
end
function host_display(s)
return string.gsub(string.gsub(s, "Gregs.*:(.*)", "%1"), "gweber%-(%w+).*:(.*)", "%1 %2")
end
function id(s)
return s
end
wezterm.on("format-tab-title", function(tab, tabs, panes, config, hover, max_width)
local pane = tab.active_pane
local title = title_display(pane.title) -- wd_display(pane.current_working_dir) .. " " .. basename(pane.foreground_process_name) -- .. " " .. pane.pane_id
return {
{Text=" " .. title .. " "},
}
end)
return {
tab_bar_at_bottom = true,
scrollback_lines = 99999,
-- color_scheme = "Solarized Dark Higher Contrast",
-- color_scheme = "Violet Light",
color_scheme = "Solarized (light) (terminal.sexy)"
keys=keys,
window_padding = {
left = 0,
right = 0,
top = 0,
bottom = 0,
}
}