Add zsh anything.el plugin
[zsh.git] / .zsh / 70_Plugins.zsh
1 # -*- mode: sh;-*-
2
3 # Config for plugins loaded below
4
5
6 # for per-directory-history
7 HISTORY_BASE=${ZDOTDIR}/var/dirhist
8 mkdir -p ${HISTORY_BASE}
9
10 function bindkey() {
11 if zstyle -t ':ganneff:config' pluginbindkeys; then
12 # User allows plugins to bind keys
13 builtin bindkey "$@"
14 [[ "${DEBUG}" = "no" ]] && return
15 print -b -r "$fg_no_bold[cyan]plugin allowed to run${reset_color}: 'bindkey ${(q)@}'"
16 else
17 [[ "${DEBUG}" = "no" ]] && return
18 print -b -r "$fg_no_bold[red]plugin forbidden to run${reset_color}: 'bindkey ${(q)@}'"
19 fi
20 }
21
22 __ () {
23 local plugdir=${ZDOTDIR}/plugins
24 if [ -d ${plugdir} ]; then
25 typeset -a plugins
26 zstyle -a ':ganneff:config' plugins plugins \
27 || plugins=(
28 git-extras.plugin.zsh
29 history-substring-search.zsh
30 per-directory-history.plugin.zsh
31 zaw.zsh
32 )
33 for file in $plugins; do
34 debug "PLUGIN: Trying to load ${file}"...
35 source ${plugdir}/${file}
36 debug "PLUGIN: $fg_no_bold[green]done"
37 done
38 fi
39
40 # And now (possibly) oh-my-zsh style plugins
41 if [[ -d ${ZDOTDIR}/plugins/ohmy ]]; then
42 typeset -a omplug
43 zstyle -a ':ganneff:config' ohmyplugins omplug
44 for plug in ${omplug}; do
45 if [[ -f ${ZDOTDIR}/plugins/ohmy/${plug}/${plug}.plugin.zsh ]]; then
46 source ${ZDOTDIR}/plugins/ohmy/${plug}/${plug}.plugin.zsh
47 fi
48 done
49 fi
50 } && __
51
52 unfunction bindkey
53