Improving SSH autocomplete to zsh 0 ▲ Nat? Nat. Nat! 1 hour ago · Tech · hide Ok, small thing that had been annoying me. I use oh-my-zsh, and when you ssh n it autocompletes based on known hosts not what's in your ~/.ssh/config I add the following to my dotfiles: # Better SSH/Rsync/SCP Autocomplete # _ssh_hosts skips ~/.ssh/config whenever known_hosts matches, so feed config Host aliases in directly zstyle -e ':completion:*:(ssh|scp|rsync|sftp):*' hosts 'reply=(); local f l; for f in ~/.ssh/config(N) ~/.orbstack/ssh/config(N); for l in ${(f)"$(<$f)"}; [[ $l == (#i)[[:space:]]#host[[:space:]]##* ]] && reply+=(${${=l}[2,-1]:#(*[*?]*|!*)})' zstyle ':completion:*:(scp|rsync):*' tag-order ' hosts:-ipaddr:ip\ address hosts:-host:host files' zstyle ':completion:*:(ssh|scp|rsync):*:hosts-host' ignored-patterns '<->.<->.<->.<->' '*:*' loopback ip6-loopback localhost ip6-localhost broadcasthost zstyle ':completion:*:(ssh|scp|rsync):*:hosts-ipaddr' ignored-patterns '^(<->.<->.<->.<->|(|::)([[:xdigit:].]##:(#c,2))##(|%*))' '127.0.0.<->' '255.255.255.255' '::1' 'fe80::*'… Commenting on Bubbles has been removed. Why? If you want to talk about this post, write to the author, use the comments on their blog if it has them, or reply with a "RE:" post on your own blog. Suggestions? feedback@bubbles.town