#+END_SRC
+** Plugins
+This framework by default has most of its function included directly,
+configurable using the zstyle way described already. But there are as
+many different needs to a shell as there are users of it, so besides
+all the other flexibility already given, one can easily include
+"plugins" from wherever.
+
+Plugins are simply files that contain zsh code. Which can do whatever
+it wants with your shell, so be careful. One exception: Unless the
+zstyle /:ganneff:config:pluginbindkeys/ is true, plugins are forbidden to
+bind keys.
+
+Two ways to do it:
+1. Place the plugin you want to load into =${ZDOTDIR}/plugins= or any
+ subdirectory of it, and add the full path and filename, relative to
+ =${ZDOTDIR}/plugins= to the zstyle /ganneff:config:plugins/ in your
+ =${ZDOTDIR}/zshenv.local=.
+2. For oh-my-zsh style plugins, put the plugin directory into a
+ subdirectory of =${ZDOTDIR}/plugins/ohmy= and add the name to the
+ zstyle /ganneff:config:ohmyplugins/ in your =${ZDOTDIR}/zshenv.local=
* Sources
** Prompt
DEBUG=${DEBUG:-no}
+# In case the user wants oh-my-zsh plugins, we add their path to the
+# fpath, as they often have completion functions.
+typeset -a ompath
+if [[ -d ${ZDOTDIR}/plugins/ohmy ]]; then
+ local -a omplug
+ zstyle -a ':ganneff:config' ohmyplugins omplug
+ for plug in ${omplug}; do
+ if [[ -f ${ZDOTDIR}/plugins/ohmy/${plug}/${plug}.plugin.zsh ]]; then
+ ompath+=(${ZDOTDIR}/plugins/ohmy/${plug})
+ fi
+ done
+fi
+unset omplug
+
# Path to search for autoloadable functions.
-fpath=( ${ZDOTDIR}/functions "$fpath[@]" )
+fpath=( ${ZDOTDIR}/functions $ompath[@] $fpath[@] )
+unset ompath
+
# Only unique entries please.
typeset -U fpath
fpath=( ${^fpath}(N-/) )
## function calls).
# zstyle ':ganneff:config' mimesetup false
+## List of plugins to load.
+## List their full path, relative to ${ZDOTDIR}/plugins here.
+## It doesn't matter where you get the plugins from, as long as they are
+## zsh files that can be sourced. As they can do everything, be careful
+## what you load.
+# zstyle ':ganneff:config' plugins git-extras.plugin.zsh \
+# history-substring-search.zsh \
+# per-directory-history.plugin.zsh
+
+## oh-my-zsh plugins can also be loaded, in case you like one of it.
+## Simply list their names here, and put their directories into
+## ${ZDOTDIR}/plugins/ohmy
+#zstyle ':ganneff:config' ohmyplugins extract
+
+## Allow plugins to bind keys? I really dislike if plugins overwrite my
+## keybindings, so I always do them myself. If you prefer to let them do
+## it, set it to true. If set to false, you most probably want a
+## ${ZDOTDIR}/80_KeyBindings.zsh.local (or one of the variable
+## subdirectories, Keybindings.zsh) to set the keybindings.
+# zstyle ':ganneff:config' pluginbindkeys false
+
########################################################################
### Prompt setup ###
## use vcs_info in prompt