feat: j dotfiles completion

This commit is contained in:
AngeD 2023-11-12 14:42:49 +01:00
parent fc8f802133
commit fceb26bc0b
2 changed files with 2 additions and 2 deletions

View File

@ -26,7 +26,7 @@ alias watch='coloralias watch -c -- '
alias xargs='xargs ' alias xargs='xargs '
function j() { function j() {
local dests=("${(@f)$(find . -name "$1*" -mount -type d 2> /dev/null)}") local dests=("${(@f)$(find . -mount -name "$1*" -type d 2> /dev/null)}")
local dest="${dests:-$1}" local dest="${dests:-$1}"
[ -n "${dests[2]}" ] && dest="$(printf '%s\n' "${dests[@]}" | fzf)" [ -n "${dests[2]}" ] && dest="$(printf '%s\n' "${dests[@]}" | fzf)"

View File

@ -1,3 +1,3 @@
#compdef j #compdef j
_arguments "1: :(**/"$1")" _arguments "1: :($(find . -mount -name "$1*" -type d -printf "'%P' " 2> /dev/null))"