Skip to content

Instantly share code, notes, and snippets.

@swalberg
Created June 19, 2012 18:29
Show Gist options
  • Save swalberg/2955754 to your computer and use it in GitHub Desktop.
Save swalberg/2955754 to your computer and use it in GitHub Desktop.
ssh autocompletion
function _ssh_completion() {
perl -ne 'print "$1 " if /^Host (.+)$/' ~/.ssh/config
}
complete -W "$(_ssh_completion)" ssh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment