diff options
author | Marc Cornellà <marc.cornella@live.com> | 2018-04-22 12:59:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-22 12:59:40 +0200 |
commit | dd39d43021f78bf88dff7db43f616866c3596c1f (patch) | |
tree | fa71ba184eb0adc9554363c04fc9927dddd1650e /plugins/zsh_reload/zsh_reload.plugin.zsh | |
parent | 9a71864288e5fb3898b0764db3e547cf7bb7328c (diff) | |
parent | fbbe902c38549dae8c8e997daeebcc797103ab7c (diff) | |
download | zsh-dd39d43021f78bf88dff7db43f616866c3596c1f.tar.gz zsh-dd39d43021f78bf88dff7db43f616866c3596c1f.tar.bz2 zsh-dd39d43021f78bf88dff7db43f616866c3596c1f.zip |
Merge pull request #5601 from mcornella/refactor-zsh_reload-plugin
Refactor zsh_reload plugin
Diffstat (limited to 'plugins/zsh_reload/zsh_reload.plugin.zsh')
-rw-r--r-- | plugins/zsh_reload/zsh_reload.plugin.zsh | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/plugins/zsh_reload/zsh_reload.plugin.zsh b/plugins/zsh_reload/zsh_reload.plugin.zsh index cde9ebeca..51048ba9d 100644 --- a/plugins/zsh_reload/zsh_reload.plugin.zsh +++ b/plugins/zsh_reload/zsh_reload.plugin.zsh @@ -1,13 +1,12 @@ -# reload zshrc -function src() -{ - local cache=$ZSH_CACHE_DIR - autoload -U compinit zrecompile - compinit -d "$cache/zcomp-$HOST" +src() { + local cache="$ZSH_CACHE_DIR" + autoload -U compinit zrecompile + compinit -i -d "$cache/zcomp-$HOST" - for f in ~/.zshrc "$cache/zcomp-$HOST"; do - zrecompile -p $f && command rm -f $f.zwc.old - done + for f in ~/.zshrc "$cache/zcomp-$HOST"; do + zrecompile -p $f && command rm -f $f.zwc.old + done - source ~/.zshrc + # Use $SHELL if available; remove leading dash if login shell + [[ -n "$SHELL" ]] && exec ${SHELL#-} || exec zsh } |