From 7218c4544328176afe897ccce88960ad289872de Mon Sep 17 00:00:00 2001 From: Nikita Uvarov Date: Wed, 23 Aug 2017 13:05:49 +0200 Subject: [PATCH] zsh: add completions to fpath --- modules/programs/zsh.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/programs/zsh.nix b/modules/programs/zsh.nix index 8526c71dc..b8f203ee9 100644 --- a/modules/programs/zsh.nix +++ b/modules/programs/zsh.nix @@ -107,6 +107,11 @@ in ${if cfg.history.ignoreDups then "setopt" else "unsetopt"} HIST_IGNORE_DUPS ${if cfg.history.share then "setopt" else "unsetopt"} SHARE_HISTORY + # Tell zsh how to find installed completions + for p in ''${(z)NIX_PROFILES}; do + fpath+=($p/share/zsh/site-functions $p/share/zsh/$ZSH_VERSION/functions) + done + ${if cfg.enableCompletion then "autoload -U compinit && compinit" else ""} ${optionalString (cfg.enableAutosuggestions) "source ${pkgs.zsh-autosuggestions}/share/zsh-autosuggestions/zsh-autosuggestions.zsh"