Created
January 16, 2012 10:45
-
-
Save withgod/1620180 to your computer and use it in GitHub Desktop.
zsh ssh hostname 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
_cache_hosts=(`grep 'ssh ' ~/.zsh_history | awk -F ';' '{print $2}' |sed 's/[a-z0-9_\-]\+@//' \ | |
| egrep '^ssh [a-z0-9\-\.]+$' | sort | uniq | sed 's/^ssh //'`) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment