mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-12-19 20:29:45 +01:00
Merge pull request #672 from eMxyzptlk/zsh_reload
Add zsh_reload which provides src function, this function will source .zshrc and rebuilds cache
This commit is contained in:
commit
d41c588d1b
1 changed files with 13 additions and 0 deletions
13
plugins/zsh_reload/zsh_reload.plugin.zsh
Normal file
13
plugins/zsh_reload/zsh_reload.plugin.zsh
Normal file
|
@ -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
|
||||||
|
}
|
Loading…
Reference in a new issue