X-Git-Url: https://git.grml.org/?a=blobdiff_plain;f=etc%2Fzsh%2Fzshrc;h=b369aca042240236e530155e23947a82163d3b84;hb=f3f1387761d36244009785d92ddf60dd98663d76;hp=8ac9d7da20f70d85e085debcdddeb97cf1c107a1;hpb=da239bb6fb273bd66d806c3049a352dfad6276cf;p=grml-etc-core.git diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index 8ac9d7d..b369aca 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -481,6 +481,7 @@ setopt unset # setting some default values NOCOR=${NOCOR:-0} +NOETCHOSTS=${NOETCHOSTS:-0} NOMENU=${NOMENU:-0} NOPRECMD=${NOPRECMD:-0} COMMAND_NOT_FOUND=${COMMAND_NOT_FOUND:-0} @@ -890,14 +891,21 @@ function grmlcomp () { fi # host completion + _etc_hosts=() + _ssh_config_hosts=() + _ssh_hosts=() if is42 ; then - [[ -r ~/.ssh/config ]] && _ssh_config_hosts=(${${(s: :)${(ps:\t:)${${(@M)${(f)"$(<$HOME/.ssh/config)"}:#Host *}#Host }}}:#*[*?]*}) || _ssh_config_hosts=() - [[ -r ~/.ssh/known_hosts ]] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=() - [[ -r /etc/hosts ]] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(/dev/null 2>&1; then - alias ip='command ip --color=auto' +if ip -color=auto addr show dev lo >/dev/null 2>&1; then + alias ip='command ip -color=auto' fi if [[ -r /proc/mdstat ]]; then