nix-config/homes/x86_64-linux/marshall@navis/wezterm.lua

135 lines
3.1 KiB
Lua
Raw Normal View History

2024-07-28 02:49:27 -04:00
local c = wezterm.config_builder()
2024-06-13 23:47:00 -04:00
wezterm.on('user-var-changed', function(window, pane, name, value)
local overrides = window:get_config_overrides() or {}
2024-07-28 03:29:11 -04:00
if name == 'ZEN_MODE' then
local incremental = value:find('+')
2024-06-13 23:47:00 -04:00
local number_value = tonumber(value)
if incremental ~= nil then
2024-07-28 03:29:11 -04:00
while number_value > 0 do
2024-06-13 23:47:00 -04:00
window:perform_action(wezterm.action.IncreaseFontSize, pane)
number_value = number_value - 1
end
overrides.enable_tab_bar = false
elseif number_value < 0 then
window:perform_action(wezterm.action.ResetFontSize, pane)
overrides.font_size = nil
overrides.enable_tab_bar = true
else
overrides.font_size = number_value
overrides.enable_tab_bar = false
end
end
window:set_config_overrides(overrides)
end)
2024-06-14 00:49:28 -04:00
wezterm.on('format-window-title', function(tab, pane, tabs, panes, config)
2024-07-28 03:29:11 -04:00
local zoomed = ''
2024-06-13 23:47:00 -04:00
if tab.active_pane.is_zoomed then
zoomed = '[Z] '
end
2024-07-28 03:29:11 -04:00
local index = ''
2024-06-13 23:47:00 -04:00
if #tabs > 1 then
index = string.format('[%d/%d] ', tab.tab_index + 1, #tabs)
end
return 'WezTerm - ' .. zoomed .. index .. tab.active_pane.title
end)
wezterm.plugin.require('https://github.com/nekowinston/wezterm-bar').apply_to_config(c, {
position = 'bottom',
max_width = 32,
dividers = 'slant_right',
indicator = {
leader = {
enabled = true,
off = '',
on = '',
},
mode = {
enabled = true,
names = {
resize_mode = 'RESIZE',
copy_mode = 'VISUAL',
search_mode = 'SEARCH',
},
},
},
tabs = {
numerals = 'arabic',
pane_count = 'subscript',
brackets = {
2024-07-28 03:29:11 -04:00
active = { '', ':' },
inactive = { '', ':' },
2024-06-13 23:47:00 -04:00
},
},
clock = {
enabled = true,
format = '%l:%M %p',
},
})
local act = wezterm.action
local keybinds = {
{
key = 'Enter',
mods = 'CTRL|SHIFT',
action = act.SplitHorizontal({ domain = 'CurrentPaneDomain' }),
},
{
key = 'h',
mods = 'CTRL|SHIFT',
action = act.ActivatePaneDirection('Left'),
},
{
key = 'l',
mods = 'CTRL|SHIFT',
2024-07-28 03:29:11 -04:00
action = act.ActivatePaneDirection('Right'),
2024-06-13 23:47:00 -04:00
},
{
key = 'k',
mods = 'CTRL|SHIFT',
2024-07-28 03:29:11 -04:00
action = act.ActivatePaneDirection('Up'),
2024-06-13 23:47:00 -04:00
},
{
key = 'j',
mods = 'CTRL|SHIFT',
2024-07-28 03:29:11 -04:00
action = act.ActivatePaneDirection('Down'),
2024-06-13 23:47:00 -04:00
},
{
key = 't',
mods = 'CTRL|SHIFT',
2024-07-28 03:29:11 -04:00
action = act.SpawnCommandInNewTab({ cwd = wezterm.home_dir }),
},
2024-06-13 23:47:00 -04:00
}
local config = {
adjust_window_size_when_changing_font_size = false,
color_scheme = 'Catppuccin Mocha',
cursor_blink_ease_in = 'Constant',
cursor_blink_ease_out = 'Constant',
cursor_blink_rate = 500,
default_cursor_style = 'BlinkingBar',
enable_kitty_graphics = true,
enable_scroll_bar = false,
2024-09-28 22:03:51 -04:00
enable_wayland = true,
2024-06-13 23:47:00 -04:00
font_size = 12,
font = wezterm.font('Maple Mono NF'),
2024-09-28 22:03:51 -04:00
front_end = 'WebGpu',
2024-06-13 23:47:00 -04:00
keys = keybinds,
underline_position = -4,
use_fancy_tab_bar = false,
2024-09-28 22:03:51 -04:00
window_decorations = 'NONE',
2024-06-13 23:47:00 -04:00
warn_about_missing_glyphs = false,
window_background_opacity = 0.8,
window_padding = { left = 0, right = 0, top = 0, bottom = 0 },
}
for k, v in pairs(config) do
c[k] = v
end
return c