Add gpgwkd function for gpg key fetches
[zsh.git] / .zsh / external / zaw / sources / cdr.zsh
1 #
2 # zaw-src-cdr
3 #
4 # zaw source for recent directories
5 #
6
7 (( $+functions[cdr] )) || return
8
9 function zaw-src-cdr () {
10 setopt local_options extended_glob
11 : ${(A)candidates::=${${(f)"$(cdr -l)"}##<-> ##}}
12 actions=(zaw-src-cdr-cd zaw-src-cdr-insert zaw-src-cdr-prune)
13 act_descriptions=("cd" "insert" "prune")
14 options=("-m" "-s" "${BUFFER##cd(r|) }")
15 }
16
17 function zaw-src-cdr-cd () {
18 BUFFER="cd $1"
19 zle accept-line
20 }
21
22 function zaw-src-cdr-insert () {
23 [[ -z "$LBUFFER" ]] || LBUFFER+=" "
24 [[ "$LBUFFER[-1]" == " " ]] || LBUFFER+=" "
25 LBUFFER+="${(j. .)@}"
26 }
27
28 function zaw-src-cdr-prune () {
29 local -aU reply
30 autoload -Uz chpwd_recent_filehandler
31 chpwd_recent_filehandler
32 : ${(A)reply::=${reply:#(${(~j.|.)${~@}})}}
33 chpwd_recent_filehandler $reply
34 }
35
36 zaw-register-src -n cdr zaw-src-cdr