From 1ca16d248dda679871b5ff70684695f8bddb99a9 Mon Sep 17 00:00:00 2001 From: druckdev <63563978+druckdev@users.noreply.github.com> Date: Thu, 20 Aug 2020 00:53:26 +0200 Subject: [PATCH] Add conf completion for programs in HOME --- .config/zsh/plugins/completion/_conf | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.config/zsh/plugins/completion/_conf b/.config/zsh/plugins/completion/_conf index 345271d..53b04b4 100644 --- a/.config/zsh/plugins/completion/_conf +++ b/.config/zsh/plugins/completion/_conf @@ -12,12 +12,16 @@ local w3="${words[$#words - 3]}" if [ -z $w2 ]; then # first word to complete # move into config directory pushd -q "${XDG_CONFIG_HOME:-$HOME/.config}/" - # list all directories local paths="$(find -L *(-/) -maxdepth $_MAX_DEPTH -type d 2>/dev/null | xargs)" - # TODO: find in $HOME + # move back from config directory + popd -q - # move back + # move into HOME + pushd -q "$HOME" + # list all directories starting with a dot (but remove that dot) + paths+="$(find -L .*~.cache(-/) -maxdepth $_MAX_DEPTH -type d 2>/dev/null | sed 's/^\.//' | xargs)" + # move back from HOME popd -q # use list for completion