Skip to content

Commit

Permalink
Add option to disable zsh global compinit
Browse files Browse the repository at this point in the history
Fixes #855.
  • Loading branch information
mrdomino committed Jan 20, 2024
1 parent 74ab022 commit 3a672f4
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion modules/programs/zsh/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3a672f4

Please sign in to comment.