Skip to content

Instantly share code, notes, and snippets.

@withgod
Created January 16, 2012 10:45
Show Gist options
  • Save withgod/1620180 to your computer and use it in GitHub Desktop.
Save withgod/1620180 to your computer and use it in GitHub Desktop.
zsh ssh hostname completion
_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