added ssh config for host completion
This commit is contained in:
parent
9d0d95f967
commit
c3b4ef82bc
1 changed files with 2 additions and 0 deletions
|
@ -36,10 +36,12 @@ cdpath=(.)
|
|||
[ -r /etc/ssh/ssh_known_hosts ] && _global_ssh_hosts=(${${${${(f)"$(</etc/ssh/ssh_known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=()
|
||||
[ -r ~/.ssh/known_hosts ] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=()
|
||||
[ -r /etc/hosts ] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(</etc/hosts)"}%%\#*}##[:blank:]#[^[:blank:]]#}}} || _etc_hosts=()
|
||||
[ -r ~/.ssh/config ] && _ssh_config=($(cat ~/.ssh/config | sed -ne 's/Host[=\t ]//p')) || _ssh_config=()
|
||||
hosts=(
|
||||
"$_global_ssh_hosts[@]"
|
||||
"$_ssh_hosts[@]"
|
||||
"$_etc_hosts[@]"
|
||||
"$_ssh_config[@]"
|
||||
"$HOST"
|
||||
localhost
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue