Skip to content

Instantly share code, notes, and snippets.

@sdvg
Created July 30, 2012 16:04
Show Gist options
  • Save sdvg/3208040 to your computer and use it in GitHub Desktop.
Save sdvg/3208040 to your computer and use it in GitHub Desktop.
Add tab completion for SSH hostnames
# Add tab completion for SSH hostnames based on ~/.ssh/config, ignoring wildcards
[ -e "$HOME/.ssh/config" ] && complete -o "default" -o "nospace" -W "$(grep "^Host" ~/.ssh/config | grep -v "[?*]" | cut -d " " -f2)" scp sftp ssh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment