# ### search a destination from cdr list function peco-get-destination-from-cdr() { cdr -l | \ sed -e 's/^[[:digit:]]*[[:blank:]]*//' | \ peco --query "$LBUFFER" } ### search a destination from cdr list and cd the destination function peco-cdr() { local destination="$(peco-get-destination-from-cdr)" if [ -n "$destination" ]; then BUFFER="cd $destination" zle accept-line else zle reset-prompt fi }