From 998e0e24fe505824471168d9c9344e203a98c487 Mon Sep 17 00:00:00 2001 From: David Runge Date: Fri, 5 Jan 2024 17:02:58 +0100 Subject: zsh: Add local dir for shell completions Add local dir for custom completions. Check all dirs for existence before adding them to fpath. Signed-off-by: David Runge --- .config/zsh/.zshrc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 741497b..0a0edfc 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -247,10 +247,16 @@ unsetopt CLOBBER # Externals # -# TODO: Add conditional to check for availability - # include completions path in directory -fpath=(/usr/share/zsh/site-functions/ $fpath) +completion_dirs=( + /usr/share/zsh/site-functions + "$HOME/.config/zsh/completions" +) +for p in ${completion_dirs}; do + if [[ -d "$p" ]]; then + fpath=("$p" $fpath) + fi +done # Completion # -- cgit v1.2.3-54-g00ecf