changed some stuff

This commit is contained in:
eeleater 2023-11-09 09:18:57 +01:00
parent 16e4580f1c
commit 8ceb1be386
2 changed files with 5 additions and 2 deletions

View file

@ -15,10 +15,14 @@ zstyle ':completion:*:(ssh|scp|sshfs|mosh|rsync):*:hosts-ipaddr' ignored-pattern
[ -r /etc/ssh/ssh_known_hosts ] && _global_ssh_hosts=(${${${${(f)"$(</etc/ssh/ssh_known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _global_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 /etc/hosts_network ] && : ${(A)_etc_hosts_network:=${(s: :)${(ps:\t:)${${(f)~~"$(</etc/hosts_network)"}%%\#*}##[:blank:]#[^[:blank:]]#}}} || _etc_hosts_network=()
hosts=(
# "$_ssh_config[@]"
# "$_global_ssh_hosts[@]"
# "$_ssh_hosts[@]"
# "$_etc_hosts[@]"
)
[ -r /etc/hosts_network ] && hosts+=("$_etc_hosts_network[@]")
zstyle ':completion:*:hosts' hosts $hosts