Skip to content

Instantly share code, notes, and snippets.

@swalberg
Created January 9, 2020 18:46
Show Gist options
  • Save swalberg/366c9dcd047b2a6c1be901f2963b3b5e to your computer and use it in GitHub Desktop.
Save swalberg/366c9dcd047b2a6c1be901f2963b3b5e to your computer and use it in GitHub Desktop.
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