Skip to content

Instantly share code, notes, and snippets.

@liwh
Created March 30, 2011 09:13
Show Gist options
  • Save liwh/894109 to your computer and use it in GitHub Desktop.
Save liwh/894109 to your computer and use it in GitHub Desktop.
reload functon for zsh completion
#when we create new function or install new bin , the default zsh cant get the new completion for us,so we
#can add a new function for this problem,you can add the blow content in your .zshrc file
function reload() {
if [[ "$#*" -eq 0 ]]; then
test -r /etc/zsh/zsh-oli && . /etc/zsh/zsh-oli
test -r ~/.zshrc && . ~/.zshrc
return 0
else
local fn
for fn in $*; do
unfunction $fn
autoload -U $fn
done
fi
}
compdef _functions reload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment