diff options
-rw-r--r-- | .zshrc | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -660,6 +660,8 @@ zstyle ':completion:*:wine:*' file-patterns '*.(exe|EXE):exe' # don't complete usernames (the come from localhost!) zstyle ':completion:*:(ssh|scp):*' users +compdef sshrc=ssh + # complete ssh hostnames [[ -r ~/.ssh/known_hosts ]] && _ssh_hosts=(${${${${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}%%:*}#\[}%\]}) || _ssh_hosts=() [[ -r ~/.ssh/config ]] && _ssh_config_hosts=($(sed -rn 's/host\s+(.+)/\1/ip' "$HOME/.ssh/config" | grep -v "\*" )) || _ssh_config_hosts=() |