Skip to content

Instantly share code, notes, and snippets.

View thyme-87's full-sized avatar

thyme-87 thyme-87

  • Berlin, Germany
View GitHub Profile
@thyme-87
thyme-87 / ssh-autocomplete-broken-osx
Created October 10, 2018 13:35
SSH autocomplete based on ~/.ssh/config for broken beyond repair and beneath contempt OSX
##autocomplete ssh
#Thanks to: https://gist.github.com/magnetikonline/bcd4186e14ed02145390
function _completeSSHHosts {
COMPREPLY=()
local currentWord=${COMP_WORDS[COMP_CWORD]}
local completeHosts=$(
cat "$HOME/.ssh/config" | \
grep --extended-regexp --regexp "^(Host|host) +[^* ]+? *$" | \