aboutsummaryrefslogtreecommitdiff
path: root/.config/wezterm/appearance.lua
blob: f786e85bab4c37c5db7003d278bcb197d7464997 (plain)
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
local wezterm = require("wezterm")

local function basename(s)
	return string.gsub(s, "(.*[/\\])(.*)", "%2")
end

local function home_or_path(path)
	local realpath = tostring(path):sub(14, -1) -- file://lambda
	local home = os.getenv("HOME")
	return realpath == home and "~" or realpath
end

wezterm.on("format-tab-title", function(tab)
	local tab_format = {
		{ Text = " " },
		{ Text = tostring(tab.tab_index + 1) },
		{ Text = "  " },
		{ Text = basename(home_or_path(tab.active_pane.current_working_dir)) },
		{ Text = " " },
		"ResetAttributes",
	}

	return wezterm.format(tab_format)
end)

return {
	-- tabs
	show_new_tab_button_in_tab_bar = false,
	use_fancy_tab_bar = false,
	tab_bar_at_bottom = true,
	hide_tab_bar_if_only_one_tab = true,

	-- font
	font = wezterm.font({
		-- family = "FiraCode Nerd Font Mono",
		family = "Iosevka Comfy",
		-- harfbuzz_features = { "ss02", "ss03", "ss04", "ss08" }
	}),
	font_size = 10.5,
	adjust_window_size_when_changing_font_size = false,
	allow_square_glyphs_to_overflow_width = "Never",

	-- cursor
	default_cursor_style = "BlinkingUnderline",
	cursor_blink_rate = 500,
	animation_fps = 1,

	-- colors
	colors = R("colors"),
	bold_brightens_ansi_colors = false,
}