Created
December 2, 2010 13:07
-
-
Save cjk/725256 to your computer and use it in GitHub Desktop.
ZSH hosts completion
This file contains 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
hosts=(`hostname` myhost.domain.com c00100014181.corpintra.net) | |
[[ -f ~/.ssh/known_hosts ]] && hosts=($hosts `awk '{print $1}' ~/.ssh/known_hosts | tr ',' '\n' `) | |
[[ -f ~/.ssh/config ]] && hosts=($hosts `grep "^Host" ~/.ssh/config | sed s/Host\ // | egrep -v '^\*$'`) | |
zstyle ':completion:*:hosts' hosts $hosts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment