Configuration files
1local wezterm = require("wezterm")
2
3local config = wezterm.config_builder()
4
5local font_family = "BerkeleyMono Nerd Font"
6
7if wezterm.hostname() == "WS" then
8 config.default_prog = { "pwsh" }
9end
10config.color_scheme = "Kanagawa (Gogh)"
11config.font = wezterm.font(font_family)
12config.default_cursor_style = "BlinkingUnderline"
13config.window_frame = {
14 font = wezterm.font({ family = font_family, weight = "Bold" }),
15 active_titlebar_bg = "#1f1f28",
16 inactive_titlebar_bg = "#1f1f28",
17}
18
19config.colors = {
20 tab_bar = {
21 inactive_tab_edge = "#1f1f28",
22 background = "1f1f28",
23 active_tab = {
24 fg_color = "dcd7ba",
25 bg_color = "1f1f28",
26 },
27 inactive_tab = {
28 fg_color = "807d6c",
29 bg_color = "14141a",
30 },
31 },
32}
33config.initial_rows = 30
34config.initial_cols = 120
35config.front_end = "OpenGL"
36config.window_decorations = "INTEGRATED_BUTTONS | RESIZE"
37config.integrated_title_button_color = "#2d4f67"
38config.freetype_load_target = "Light"
39config.window_background_opacity = 0
40config.win32_system_backdrop = "Mica"
41
42local function set_max_fps_to_refresh(window)
43 local max_refresh = wezterm.gui.screens().active.max_fps
44 local overrides = window:get_config_overrides() or {}
45 if max_refresh ~= nil then
46 overrides.max_fps = max_refresh
47 overrides.animation_fps = math.floor(overrides.max_fps / 2)
48 end
49 window:set_config_overrides(overrides)
50end
51wezterm.on("window-focus-changed", set_max_fps_to_refresh)
52
53local leader_key = "a"
54config.leader = { key = leader_key, mods = "CTRL", timeout_milliseconds = 1000 }
55config.keys = {
56 {
57 key = "|",
58 mods = "LEADER",
59 action = wezterm.action.SplitHorizontal({ domain = "CurrentPaneDomain" }),
60 },
61 {
62 key = "-",
63 mods = "LEADER",
64 action = wezterm.action.SplitVertical({ domain = "CurrentPaneDomain" }),
65 },
66 {
67 key = "d",
68 mods = "LEADER",
69 action = wezterm.action.CloseCurrentPane({ confirm = true }),
70 },
71 {
72 key = "t",
73 mods = "LEADER",
74 action = wezterm.action.SpawnTab("CurrentPaneDomain"),
75 },
76 {
77 key = "w",
78 mods = "LEADER",
79 action = wezterm.action.CloseCurrentTab({ confirm = true }),
80 },
81 {
82 key = leader_key,
83 mods = "LEADER",
84 action = wezterm.action.SendKey({ key = leader_key, mods = "CTRL" }),
85 },
86}
87
88return config