You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
wting_autojump/bin/_j

19 lines
425 B

#compdef j
cur=${words[2, -1]}
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
(( $i > 2 )) && compadd -V $i -U "${=cur[*]}"