mirror of
https://github.com/nix-community/home-manager
synced 2024-11-30 06:59:45 +01:00
zsh: add completionInit
option (#2046)
Factored out from original .zshrc construction.
This commit is contained in:
parent
aa36e2d6b4
commit
42847469b3
1 changed files with 8 additions and 2 deletions
|
@ -279,6 +279,12 @@ in
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
completionInit = mkOption {
|
||||||
|
default = "autoload -U compinit && compinit";
|
||||||
|
description = "Initialization commands to run when completion is enabled.";
|
||||||
|
type = types.lines;
|
||||||
|
};
|
||||||
|
|
||||||
enableAutosuggestions = mkOption {
|
enableAutosuggestions = mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
description = "Enable zsh autosuggestions";
|
description = "Enable zsh autosuggestions";
|
||||||
|
@ -469,7 +475,7 @@ in
|
||||||
# calling it twice causes slight start up slowdown
|
# calling it twice causes slight start up slowdown
|
||||||
# as all $fpath entries will be traversed again.
|
# as all $fpath entries will be traversed again.
|
||||||
${optionalString (cfg.enableCompletion && !cfg.oh-my-zsh.enable && !cfg.prezto.enable)
|
${optionalString (cfg.enableCompletion && !cfg.oh-my-zsh.enable && !cfg.prezto.enable)
|
||||||
"autoload -U compinit && compinit"
|
cfg.completionInit
|
||||||
}
|
}
|
||||||
|
|
||||||
${optionalString cfg.enableAutosuggestions
|
${optionalString cfg.enableAutosuggestions
|
||||||
|
@ -500,7 +506,7 @@ in
|
||||||
(builtins.readFile "${pkgs.zsh-prezto}/share/zsh-prezto/runcoms/zshrc")}
|
(builtins.readFile "${pkgs.zsh-prezto}/share/zsh-prezto/runcoms/zshrc")}
|
||||||
|
|
||||||
${concatStrings (map (plugin: ''
|
${concatStrings (map (plugin: ''
|
||||||
if [ -f "$HOME/${pluginsDir}/${plugin.name}/${plugin.file}" ]; then
|
if [[ -f "$HOME/${pluginsDir}/${plugin.name}/${plugin.file}" ]]; then
|
||||||
source "$HOME/${pluginsDir}/${plugin.name}/${plugin.file}"
|
source "$HOME/${pluginsDir}/${plugin.name}/${plugin.file}"
|
||||||
fi
|
fi
|
||||||
'') cfg.plugins)}
|
'') cfg.plugins)}
|
||||||
|
|
Loading…
Reference in a new issue