Add zsh anything.el plugin
[zsh.git] / .zsh / zaw / sources / locate.zsh
1 # zaw source for locate
2
3 autoload -U read-from-minibuffer
4
5 function zaw-src-locate() {
6 local buf
7 read-from-minibuffer "locate "
8 buf=$(locate ${(Q@)${(z)REPLY}})
9 if [[ $? != 0 ]]; then
10 return 1
11 fi
12 : ${(A)candidates::=${(f)buf}}
13 : ${(A)cand_descriptions::=${(f)buf}}
14 actions=( zaw-callback-append-to-buffer )
15 act_descriptions=( "append to buffer" )
16 }
17
18 zaw-register-src -n locate zaw-src-locate
19