d41c588d1b2880b634babdb89b49e5b7e98ee2dc
- Author
- Robby Russell <robby@planetargon.com>
- Committer
- Robby Russell <robby@planetargon.com>
- Date
Message
Merge pull request #672 from eMxyzptlk/zsh_reload
Add zsh_reload which provides src function, this function will source .zshrc and rebuilds cache
Diff
1diff --git a/plugins/zsh_reload/zsh_reload.plugin.zsh b/plugins/zsh_reload/zsh_reload.plugin.zsh
2new file mode 100644
3index 0000000000000000000000000000000000000000..a435dbc8d999bbbb0b193b44525a11ba4a6f0f1f
4--- /dev/null
5+++ b/plugins/zsh_reload/zsh_reload.plugin.zsh
6@@ -0,0 +1,13 @@
7+zsh_cache=$HOME/.zsh_cache
8+mkdir -p $zsh_cache
9+
10+# reload zshrc
11+function src()
12+{
13+ autoload -U compinit zrecompile
14+ compinit -d $zsh_cache/zcomp-$HOST
15+ for f in $HOME/.zshrc $zsh_cache/zcomp-$HOST; do
16+ zrecompile -p $f && rm -f $f.zwc.old
17+ done
18+ source ~/.zshrc
19+}