aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Runge <dave@sleepmap.de>2024-01-05 17:02:58 +0100
committerDavid Runge <dave@sleepmap.de>2024-01-05 17:02:58 +0100
commit998e0e24fe505824471168d9c9344e203a98c487 (patch)
treee471f58edf9d5830852e3d6a077e5e07aa6c0f2c
parente069e80b9698cb31ec2a228713c0aa717ace81ed (diff)
downloaddotfiles-998e0e24fe505824471168d9c9344e203a98c487.tar.gz
dotfiles-998e0e24fe505824471168d9c9344e203a98c487.tar.bz2
dotfiles-998e0e24fe505824471168d9c9344e203a98c487.tar.xz
dotfiles-998e0e24fe505824471168d9c9344e203a98c487.zip
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 <dave@sleepmap.de>
-rw-r--r--.config/zsh/.zshrc12
1 files 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
#