1
0
mirror of https://github.com/wting/autojump synced 2024-10-27 20:34:07 +00:00
wting_autojump/bin/_j

19 lines
425 B
Plaintext
Raw Normal View History

2013-12-31 15:54:50 +00:00
#compdef j
cur=${words[2, -1]}
2020-07-15 14:08:22 +00:00
integer i=1
declare -A displayMap
autojump --complete "${=cur[*]}" | while read c; do
hidden=$(echo "$c" | sed 's/\(.*__[0-9][0-9]*__\).*/\1/')
display=$(echo "$c" | sed 's/.*__[0-9][0-9]*__\(.*\)/\1/')
(( $+displayMap[$display] )) && continue
displayMap[$display]=true
compadd -V $i -U "$display";
i=$((i+1))
done
2020-07-15 14:08:22 +00:00
(( $i > 2 )) && compadd -V $i -U "${=cur[*]}"