reprogram zsh configs

This commit is contained in:
Rasyidan Akbar F. 2025-09-28 02:20:02 +07:00
commit 0068a4aee6
2 changed files with 18 additions and 30 deletions

View file

@ -57,6 +57,21 @@ in {
description = "Enable zsh-autosuggestions.";
};
autosuggestAcceptWidgets = mkOption {
type = types.listOf types.str;
default = [
"forward-char"
"end-of-line"
"vi-forward-char"
"vi-end-of-line"
"vi-add-eol"
"expand-or-complete"
"complete-word"
"fzf-completion"
];
description = "Widgets that should accept autosuggestions before running (ZSH_AUTOSUGGEST_ACCEPT_WIDGETS).";
};
enableSyntaxHighlighting = mkOption {
type = types.bool;
default = true;
@ -79,6 +94,9 @@ in {
syntaxHighlighting.enable = cfg.enableSyntaxHighlighting;
shellAliases = cfg.aliases;
initContent = lib.mkAfter cfg.extraAfter;
localVariables = lib.mkIf cfg.enableAutoSuggestion {
ZSH_AUTOSUGGEST_ACCEPT_WIDGETS = cfg.autosuggestAcceptWidgets;
};
};
}
{ programs.zsh.initContent = lib.mkOrder 550 cfg.extraBeforeCompInit; }