diff --git a/modules/programs/zsh/default.nix b/modules/programs/zsh/default.nix index 4e983e51d..7180153f3 100644 --- a/modules/programs/zsh/default.nix +++ b/modules/programs/zsh/default.nix @@ -70,6 +70,18 @@ in description = lib.mdDoc "Enable bash completion for all interactive zsh shells."; }; + programs.zsh.enableGlobalCompInit = mkOption { + type = types.bool; + default = cfg.enableCompletion; + description = lib.mdDoc '' + Enable execution of compinit call for all interactive zsh shells. + + This option can be disabled if the user wants to extend its + `fpath` and a custom `compinit` + call in the local config is required. + ''; + }; + programs.zsh.enableFzfCompletion = mkOption { type = types.bool; default = false; @@ -175,7 +187,7 @@ in ${cfg.promptInit} - ${optionalString cfg.enableCompletion "autoload -U compinit && compinit"} + ${optionalString cfg.enableGlobalCompInit "autoload -U compinit && compinit"} ${optionalString cfg.enableBashCompletion "autoload -U bashcompinit && bashcompinit"} ${optionalString cfg.enableSyntaxHighlighting