nix/modules/home-manager/wezterm/config.lua

150 lines
3.5 KiB
Lua
Raw Normal View History

2024-04-05 11:39:35 -05:00
local wezterm = require 'wezterm'
2023-11-12 11:19:33 -06:00
local config = {}
if wezterm.config_builder then
config = wezterm.config_builder()
end
2024-04-05 11:39:35 -05:00
config.font = wezterm.font_with_fallback {
{ family = "IosevkaLyteTerm", weight = 'Medium', italic = false },
2023-11-12 11:19:33 -06:00
{ family = 'Symbols Nerd Font Mono', weight = 'Regular', italic = false },
'Noto Color Emoji',
}
2024-03-27 09:12:02 -05:00
config.font_size = 12.0
-- config.window_frame.font = config.font
-- config.window_frame.font_size = font_size
2023-11-12 11:19:33 -06:00
config.default_cursor_style = 'BlinkingBar'
2024-03-27 09:12:02 -05:00
-- config.disable_default_key_bindings = true
2023-11-12 11:19:33 -06:00
config.hide_tab_bar_if_only_one_tab = true
config.use_fancy_tab_bar = false
2024-03-27 11:06:26 -05:00
config.tab_bar_at_bottom = true
2023-11-12 11:19:33 -06:00
config.window_background_opacity = 1.0
config.enable_kitty_keyboard = true
2024-03-27 11:06:26 -05:00
config.show_new_tab_button_in_tab_bar = true
2023-11-12 11:19:33 -06:00
2024-09-03 20:03:24 -05:00
-- config.front_end = "WebGpu"
2023-11-12 11:19:33 -06:00
local function tab_title(tab_info)
local title = tab_info.tab_title
if title and #title > 0 then
return title
end
return tab_info.active_pane.title
end
-- wezterm.on('format-tab-title', function (tab, tabs, panes, config, hover, max_width)
2024-04-05 11:39:35 -05:00
wezterm.on('format-tab-title', function(tab, _, _, _, _, max_width)
2023-11-12 11:19:33 -06:00
local title = tab_title(tab)
return ' ' .. string.sub(title, 0, max_width - 2) .. ' '
end)
2024-03-27 11:06:26 -05:00
-- see nix module which has home manager create this color scheme file
2024-03-27 09:12:02 -05:00
config.color_scheme = 'catppuccin-mocha-sapphire';
2023-11-12 11:19:33 -06:00
config.inactive_pane_hsb = {
saturation = 0.8,
brightness = 0.7,
}
config.keys = {
{
key = 'Insert',
mods = 'SHIFT',
2024-04-05 11:39:35 -05:00
action = wezterm.action.PasteFrom 'Clipboard'
2023-11-12 11:19:33 -06:00
},
{
key = 'v',
mods = 'CTRL|SHIFT',
2024-04-05 11:39:35 -05:00
action = wezterm.action.PasteFrom 'PrimarySelection'
2023-11-12 11:19:33 -06:00
},
{
key = 't',
mods = 'CTRL|SHIFT',
2024-04-05 11:39:35 -05:00
action = wezterm.action.SpawnTab 'CurrentPaneDomain'
2023-11-12 11:19:33 -06:00
},
{
key = 'h',
mods = 'CTRL',
2024-04-05 11:39:35 -05:00
action = wezterm.action.ActivatePaneDirection 'Left'
2023-11-12 11:19:33 -06:00
},
{
key = 'l',
mods = 'CTRL',
2024-04-05 11:39:35 -05:00
action = wezterm.action.ActivatePaneDirection 'Right'
2023-11-12 11:19:33 -06:00
},
{
key = 'k',
mods = 'CTRL',
2024-04-05 11:39:35 -05:00
action = wezterm.action.ActivatePaneDirection 'Up'
2023-11-12 11:19:33 -06:00
},
{
key = 'j',
mods = 'CTRL',
2024-04-05 11:39:35 -05:00
action = wezterm.action.ActivatePaneDirection 'Down'
2023-11-12 11:19:33 -06:00
},
{
key = 'j',
mods = 'CTRL|SHIFT',
2024-04-05 11:39:35 -05:00
action = wezterm.action.SplitVertical { domain = 'CurrentPaneDomain' }
2023-11-12 11:19:33 -06:00
},
{
key = 'l',
mods = 'CTRL|SHIFT',
2024-04-05 11:39:35 -05:00
action = wezterm.action.SplitHorizontal { domain = 'CurrentPaneDomain' }
2023-11-12 11:19:33 -06:00
},
{
key = 'k',
mods = 'CTRL|SHIFT',
2024-04-05 11:39:35 -05:00
action = wezterm.action.SplitVertical { args = { 'top' }, domain = 'CurrentPaneDomain' }
2023-11-12 11:19:33 -06:00
},
{
key = 'h',
mods = 'CTRL|SHIFT',
2024-04-05 11:39:35 -05:00
action = wezterm.action.SplitHorizontal { args = { 'right' }, domain = 'CurrentPaneDomain' }
2023-11-12 11:19:33 -06:00
},
{
key = 'p',
mods = 'CTRL|SHIFT',
action = wezterm.action.ActivateCommandPalette
},
2024-04-14 10:39:38 -05:00
{
key = 'w',
mods = 'CTRL|SHIFT',
action = wezterm.action.CloseCurrentPane { confirm = true },
},
{
key = 'w',
mods = 'CTRL|ALT|SHIFT',
action = wezterm.action.CloseCurrentTab { confirm = true },
},
2023-11-12 11:19:33 -06:00
{
key = 'l',
mods = 'CTRL|SHIFT|ALT',
action = wezterm.action.ShowDebugOverlay
},
{
key = 'r',
mods = 'CTRL|SHIFT|ALT',
2024-04-05 11:39:35 -05:00
action = wezterm.action.RotatePanes 'Clockwise'
2023-11-12 11:19:33 -06:00
},
}
-- config.unix_domains = {
2024-04-05 11:39:35 -05:00
-- {
-- name = 'unix',
-- local_echo_threshold_ms = 10,
-- },
2023-11-12 11:19:33 -06:00
-- }
-- config.default_gui_startup_args = { 'connect', 'unix' }
-- config.default_domain = 'unix'
config.window_padding = {
top = '0.5cell',
bottom = '0.5cell',
left = '1cell',
right = '1cell',
}
return config