Created
March 30, 2011 09:13
-
-
Save liwh/894109 to your computer and use it in GitHub Desktop.
reload functon for zsh completion
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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