From 09dd52af8173d727f45317b5346794b00bbe769a Mon Sep 17 00:00:00 2001 From: Michael Komitee Date: Sun, 26 Dec 2010 18:29:22 -0500 Subject: [PATCH] ignoring hosts in ~/.ssh/config ignoring users and groups with start with an _ --- lib/completion.zsh | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) 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)~~"$(