X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=etc%2Fzsh%2Fzshrc;h=f887427982ac1b322dd759aaba414fc2b96a2448;hb=HEAD;hp=8ac9d7da20f70d85e085debcdddeb97cf1c107a1;hpb=da239bb6fb273bd66d806c3049a352dfad6276cf;p=grml-etc-core.git diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index 8ac9d7d..22263e2 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 || return - tmux -q capture-pane \; save-buffer -b 0 $TMPFILE \; delete-buffer -b 0 + tmux -q capture-pane -b 0 \; save-buffer -b 0 $TMPFILE \; delete-buffer -b 0 else + [[ "$TERM" != "screen" ]] && return screen -X hardcopy $TMPFILE # screen sucks, it dumps in latin1, apparently always. so recode it # to system charset @@ -2677,8 +2685,8 @@ else fi # use ip from iproute2 with color support -if ip --color=auto addr >/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 @@ -2840,7 +2848,7 @@ if [ -e /var/log/syslog ] ; then #a1# Take a look at the syslog: \kbd{\$PAGER /var/log/syslog || journalctl} salias llog="$PAGER /var/log/syslog" # take a look at the syslog #a1# Take a look at the syslog: \kbd{tail -f /var/log/syslog || journalctl} - salias tlog="tail -f /var/log/syslog" # follow the syslog + salias tlog="tail --follow=name /var/log/syslog" # follow the syslog elif check_com -c journalctl ; then salias llog="journalctl" salias tlog="journalctl -f"