-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.wezterm.lua
83 lines (71 loc) · 2.14 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
-- pull the wezerm api
local wezterm = require("wezterm")
-- config holder
local config = wezterm.config_builder()
-- apply local config
config.color_scheme = "tokyonight_storm"
config.force_reverse_video_cursor = true
-- remove title bar
config.window_decorations = "RESIZE"
config.window_padding = {
left = 2,
right = 2,
top = 0,
bottom = 0,
}
config.colors = {
tab_bar = {
background = "rgba(0,0,0,0)",
},
}
config.text_background_opacity = 0.5
local SOLID_LEFT_ARROW = wezterm.nerdfonts.pl_right_hard_divider
local SOLID_RIGHT_ARROW = wezterm.nerdfonts.pl_left_hard_divider
config.scrollback_lines = 200000
-- This function returns the suggested title for a tab.
-- It prefers the title that was set via `tab:set_title()`
-- or `wezterm cli set-tab-title`, but falls back to the
-- title of the active pane in that tab.
function tab_title(tab_info)
local title = tab_info.tab_title
-- if the tab title is explicitly set, take that
if title and #title > 0 then
return title
end
-- Otherwise, use the title from the active pane
-- in that tab
return tab_info.active_pane.title
end
wezterm.on("format-tab-title", function(tab, tabs, panes, config, hover, max_width)
local edge_background = "#3b3052"
local background = "#3b3052"
local foreground = "#909090"
if tab.is_active then
background = "#3c1361"
foreground = "#c0c0c0"
elseif hover then
background = "#3b3052"
foreground = "#909090"
end
local edge_foreground = background
local title = tab_title(tab)
-- ensure that the titles fit in the available space,
-- and that we have room for the edges.
title = wezterm.truncate_right(title, max_width - 2)
return {
{ Background = { Color = edge_background } },
{ Foreground = { Color = edge_foreground } },
{ Text = SOLID_LEFT_ARROW },
{ Background = { Color = background } },
{ Foreground = { Color = foreground } },
{ Text = title },
{ Background = { Color = edge_background } },
{ Foreground = { Color = edge_foreground } },
{ Text = SOLID_RIGHT_ARROW },
}
end)
config.use_fancy_tab_bar = false
config.show_tabs_in_tab_bar = false
config.show_new_tab_button_in_tab_bar = false
-- file must return config table
return config