diff --git a/lib/completion.zsh b/lib/completion.zsh index 98556f25b..a829e9682 100644 --- a/lib/completion.zsh +++ b/lib/completion.zsh @@ -35,10 +35,12 @@ zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-dir cdpath=(.) # use /etc/hosts and known_hosts for hostname completion +[ -f ~/.ssh/config ] && : ${(A)ssh_config_hosts:=${${${${(@M)${(f)"$(<~/.ssh/config)"}:#Host *}#Host }:#*\**}:#*\?*}} [ -r ~/.ssh/known_hosts ] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=() [ -r ~/.host-completion ] && : ${(A)_host_completion:=${(s: :)${(ps:\t:)${${(f)~~"$(<~/.host-completion)"}%%\#*}##[:blank:]#[^[:blank:]]#}}} || _host_completion=() [ -r /etc/hosts ] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(