From ecaddafd7838d6aacf785bda4807e7edf62b0407 Mon Sep 17 00:00:00 2001 From: Kevin Cotugno Date: Fri, 23 Dec 2022 07:15:48 -0700 Subject: [PATCH] Only show directories in p completion --- .zshrc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.zshrc b/.zshrc index d1af2d2..e223ba1 100644 --- a/.zshrc +++ b/.zshrc @@ -96,11 +96,13 @@ function p { cd "$DEVPATH/$project" } -function _p { - compadd $(ls $DEVPATH) -} +if [[ $(command -v fd) ]]; then + function _p { + compadd $(fd --max-depth=1 --type=d . $DEVPATH | xargs basename -a) + } -compdef _p p + compdef _p p +fi alias e='$EDITOR' alias s="du -sh"