8af3a9af56a2311d8a0c27b57e7ae09616038b36

Author
Robby Russell <robby@planetargon.com>
Committer
Robby Russell <robby@planetargon.com>
Date

Message

Merge pull request #768 from askreet/master

global ssh_known_hosts file

Diff

 1diff --git a/lib/completion.zsh b/lib/completion.zsh
 2index b3cc918229ce3cdf60f6434cda1ecf1e7a385a77..0e5d480ff4923f147ac2355504f16f068116c720 100644
 3--- a/lib/completion.zsh
 4+++ b/lib/completion.zsh
 5@@ -32,9 +32,11 @@ zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-dir
 6 cdpath=(.)
 7 
 8 # use /etc/hosts and known_hosts for hostname completion
 9+[ -r /etc/ssh/ssh_known_hosts ] && _global_ssh_hosts=(${${${${(f)"$(</etc/ssh/ssh_known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=()
10 [ -r ~/.ssh/known_hosts ] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=()
11 [ -r /etc/hosts ] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(</etc/hosts)"}%%\#*}##[:blank:]#[^[:blank:]]#}}} || _etc_hosts=()
12 hosts=(
13+  "$_global_ssh_hosts[@]"
14   "$_ssh_hosts[@]"
15   "$_etc_hosts[@]"
16   `hostname`