From 3a672f493af58aef8fbcdbdd6d0a4b88c65aa3d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C5=8Dshin?= Date: Fri, 19 Jan 2024 22:51:18 -0500 Subject: [PATCH] Add option to disable zsh global compinit Fixes #855. --- modules/programs/zsh/default.nix | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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