summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobby Russell <robby@planetargon.com>2014-03-22 13:56:03 -0700
committerRobby Russell <robby@planetargon.com>2014-03-22 13:56:03 -0700
commitd41c588d1b2880b634babdb89b49e5b7e98ee2dc (patch)
tree9dbd14315e99da5a8b1b381ba3171b74d49390b4
parentd8a5fff1a7160e498a10b987598f236fe1d7ede3 (diff)
parent40508b79a4d25b0548e771fb3698675595230a04 (diff)
downloadzsh-d41c588d1b2880b634babdb89b49e5b7e98ee2dc.tar.gz
zsh-d41c588d1b2880b634babdb89b49e5b7e98ee2dc.tar.bz2
zsh-d41c588d1b2880b634babdb89b49e5b7e98ee2dc.zip
Merge pull request #672 from eMxyzptlk/zsh_reload
Add zsh_reload which provides src function, this function will source .zshrc and rebuilds cache
-rw-r--r--plugins/zsh_reload/zsh_reload.plugin.zsh13
1 files changed, 13 insertions, 0 deletions
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