diff --git a/lib/completion.zsh b/lib/completion.zsh index 52cc5b5..9c2dfec 100644 --- a/lib/completion.zsh +++ b/lib/completion.zsh @@ -34,9 +34,31 @@ zstyle ':completion:*:*:*:*:processes' command "ps -u `whoami` -o pid,user,comm zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories cdpath=(.) +# use /etc/hosts and known_hosts for hostname completion +[ -r ~/.ssh/known_hosts ] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=() +[ -r /etc/hosts ] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(