From 40508b79a4d25b0548e771fb3698675595230a04 Mon Sep 17 00:00:00 2001 From: Wael Nasreddine Date: Thu, 20 Oct 2011 13:10:20 +0200 Subject: [PATCH] Add zsh_reload which provides src function, this function will source .zshrc and rebuilds cache --- plugins/zsh_reload/zsh_reload.plugin.zsh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 plugins/zsh_reload/zsh_reload.plugin.zsh diff --git a/plugins/zsh_reload/zsh_reload.plugin.zsh b/plugins/zsh_reload/zsh_reload.plugin.zsh new file mode 100644 index 000000000..a435dbc8d --- /dev/null +++ b/plugins/zsh_reload/zsh_reload.plugin.zsh @@ -0,0 +1,13 @@ +zsh_cache=$HOME/.zsh_cache +mkdir -p $zsh_cache + +# reload zshrc +function src() +{ + autoload -U compinit zrecompile + compinit -d $zsh_cache/zcomp-$HOST + for f in $HOME/.zshrc $zsh_cache/zcomp-$HOST; do + zrecompile -p $f && rm -f $f.zwc.old + done + source ~/.zshrc +} \ No newline at end of file