1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 19:46:05 +01:00

kitty: add action aliases config (#6538)

This commit is contained in:
gmvar 2025-02-27 10:12:56 -08:00 committed by GitHub
parent 0208592b59
commit 343646e092
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 26 additions and 0 deletions

View file

@ -22,6 +22,10 @@ let
mkKeyValue = key: command: "map ${key} ${command}";
};
toKittyActionAliases = lib.generators.toKeyValue {
mkKeyValue = alias_name: action: "action_alias ${alias_name} ${action}";
};
toKittyEnv = lib.generators.toKeyValue {
mkKeyValue = name: value: "env ${name}=${value}";
};
@ -143,6 +147,18 @@ in {
description = "The font to use.";
};
actionAliases = mkOption {
type = types.attrsOf types.str;
default = { };
description = "Define action aliases.";
example = literalExpression ''
{
"launch_tab" = "launch --cwd=current --type=tab";
"launch_window" = "launch --cwd=current --type=os-window";
}
'';
};
keybindings = mkOption {
type = types.attrsOf types.str;
default = { };
@ -234,6 +250,7 @@ in {
shell_integration ${cfg.shellIntegration.mode}
'')
(toKittyConfig cfg.settings)
(toKittyActionAliases cfg.actionAliases)
(toKittyKeybindings cfg.keybindings)
(toKittyEnv cfg.environment)
cfg.extraConfig

View file

@ -12,6 +12,9 @@ enable_audio_bell no
scrollback_lines 10000
update_check_interval 0
action_alias launch_tab launch --cwd=current --type=tab
action_alias launch_window launch --cwd=current --type=os-window
map ctrl+c copy_or_interrupt
map ctrl+f>2 set_font_size 20

View file

@ -24,6 +24,11 @@
"ctrl+f>2" = "set_font_size 20";
};
actionAliases = {
"launch_tab" = "launch --cwd=current --type=tab";
"launch_window" = "launch --cwd=current --type=os-window";
};
environment = { LS_COLORS = "1"; };
};