mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-12 01:59:37 +08:00
kitty: add action aliases config (#6538)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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"; };
|
||||
};
|
||||
|
||||
|
||||
@@ -6,3 +6,4 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user