91 lines
4.1 KiB
Nix
91 lines
4.1 KiB
Nix
{
|
|
config,
|
|
inputs,
|
|
pkgs,
|
|
lib,
|
|
...
|
|
}:
|
|
with lib; let
|
|
cfg = config.terminal.wezterm;
|
|
in {
|
|
options = {
|
|
terminal.wezterm.enable =
|
|
mkEnableOption "enable wez's terminal";
|
|
};
|
|
config = mkIf cfg.enable {
|
|
programs.wezterm = {
|
|
enable = true;
|
|
package = inputs.wezterm.packages.${pkgs.system}.default;
|
|
extraConfig = ''
|
|
local wezterm = require 'wezterm'
|
|
local act = wezterm.action
|
|
return {
|
|
front_end = 'WebGpu',
|
|
unix_domains = {
|
|
{
|
|
name = 'unix',
|
|
},
|
|
},
|
|
enable_kitty_graphics = true,
|
|
window_padding = {
|
|
left = 0,
|
|
right = 0,
|
|
top = 0,
|
|
bottom = 0,
|
|
},
|
|
use_fancy_tab_bar = false,
|
|
inactive_pane_hsb = {
|
|
saturation = 0.8,
|
|
brightness = 0.7,
|
|
},
|
|
-- window_frame = {
|
|
-- font = wezterm.font { family = 'Cantarell', weight = 'Bold' },
|
|
-- },
|
|
disable_default_key_bindings = true,
|
|
leader = { key = 'Space', mods = 'CTRL', timeout_milliseconds = 2000 },
|
|
keys = {
|
|
{ key = 'n', mods = 'CTRL|SHIFT', action = act.ActivateTabRelative(-1) },
|
|
{ key = 'e', mods = 'CTRL|SHIFT', action = act.ActivatePaneDirection 'Down', },
|
|
{ key = 'u', mods = 'CTRL|SHIFT', action = act.ActivatePaneDirection 'Up', },
|
|
{ key = 'i', mods = 'CTRL|SHIFT', action = act.ActivateTabRelative(1) },
|
|
{ key = 'Enter', mods = 'SHIFT|CTRL', action = act.ActivateCopyMode },
|
|
{ key = 'R', mods = 'SHIFT|CTRL', action = act.ReloadConfiguration },
|
|
{ key = '+', mods = 'SHIFT|CTRL', action = act.IncreaseFontSize },
|
|
{ key = '-', mods = 'SHIFT|CTRL', action = act.DecreaseFontSize },
|
|
{ key = '0', mods = 'SHIFT|CTRL', action = act.ResetFontSize },
|
|
{ key = 'C', mods = 'SHIFT|CTRL', action = act.CopyTo 'Clipboard' },
|
|
-- { key = 'N', mods = 'SHIFT|CTRL', action = act.SpawnWindow },
|
|
{ key = 'l', mods = 'SHIFT|CTRL', action = act.CharSelect{ copy_on_select = true, copy_to = 'ClipboardAndPrimarySelection' } },
|
|
{ key = 'v', mods = 'SHIFT|CTRL', action = act.PasteFrom 'Clipboard' },
|
|
{ key = 'PageUp', mods = 'CTRL', action = act.ActivateTabRelative(-1) },
|
|
{ key = 'PageDown', mods = 'CTRL', action = act.ActivateTabRelative(1) },
|
|
{ key = 'LeftArrow', mods = 'CTRL', action = act.ActivatePaneDirection 'Left' },
|
|
{ key = 'RightArrow', mods = 'CTRL', action = act.ActivatePaneDirection 'Right' },
|
|
{ key = 'UpArrow', mods = 'CTRL', action = act.ActivatePaneDirection 'Up' },
|
|
{ key = 'DownArrow', mods = 'CTRL', action = act.ActivatePaneDirection 'Down' },
|
|
{ key = ',', mods = 'SHIFT|CTRL', action = act.SplitVertical { domain = 'CurrentPaneDomain' }, },
|
|
{ key = '.', mods = 'SHIFT|CTRL', action = act.SplitHorizontal { domain = 'CurrentPaneDomain' }, },
|
|
{ key = '%', mods = 'SHIFT|CTRL', action = act.SplitVertical { domain = 'CurrentPaneDomain' }, },
|
|
{ key = '"', mods = 'SHIFT|CTRL', action = act.SplitHorizontal { domain = 'CurrentPaneDomain' }, },
|
|
{ key = 'n', mods = 'CTRL', action = act.ActivatePaneDirection 'Left', },
|
|
{ key = 'i', mods = 'CTRL', action = act.ActivatePaneDirection 'Right', },
|
|
{ key = 't', mods = 'SHIFT|CTRL', action = act.SpawnTab 'CurrentPaneDomain' },
|
|
{ key = 'w', mods = 'SHIFT|CTRL', action = act.CloseCurrentTab{ confirm = false } },
|
|
{ key = 'f', mods = 'SHIFT|CTRL', action = act.CloseCurrentPane{ confirm = false } },
|
|
{ key = 'b', mods = 'LEADER|CTRL', action = act.SendString '\x02', },
|
|
{ key = 'Enter', mods = 'LEADER', action = act.ActivateCopyMode, },
|
|
{ key = 'p', mods = 'LEADER', action = act.PasteFrom 'PrimarySelection', },
|
|
{ key = 'k', mods = 'SHIFT|CTRL', action = act.Multiple
|
|
{
|
|
act.ClearScrollback 'ScrollbackAndViewport',
|
|
act.SendKey { key = 'L', mods = 'CTRL' },
|
|
},
|
|
},
|
|
{ key = 'r', mods = 'LEADER', action = act.ActivateKeyTable { name = 'resize_pane', one_shot = false, }, }
|
|
},
|
|
}
|
|
'';
|
|
};
|
|
};
|
|
}
|