1
0
mirror of https://github.com/wting/autojump synced 2024-09-28 14:00:46 +00:00
wting_autojump/_j

18 lines
360 B
Plaintext
Raw Normal View History

#compdef j
cur=${words[2, -1]}
ret=$(autojump --completion "${cur[*]}")
#echo "complete on " ${cur[*]}
if [ "$ret" != "" ]; then # if at least one answer
#if [ $( echo "$ret" | wc -l ) -eq 1 ]; then # Only one answer
# echo $ret
#else # several answers
for i in $(echo "$ret"); do
compadd -U $i
done
#fi
fi