X-Git-Url: https://git.siccegge.de//index.cgi?p=dotfiles%2Fzsh.git;a=blobdiff_plain;f=zshrc;h=fd2baf2825bdb7838379deb6cb5315c4affd1f8b;hp=64ad4eaceb21954fb67ff78829269572a6b7812f;hb=e24ec09cc95c3ac4391896b82fe735dcca69765f;hpb=7ae684b2c49b2696455aaf09cde67896c95f9642 diff --git a/zshrc b/zshrc index 64ad4ea..fd2baf2 100644 --- a/zshrc +++ b/zshrc @@ -47,6 +47,8 @@ zstyle ':completion:*' menu select=3 zstyle -e ':completion::*:*:*:hosts' hosts 'reply=(${=${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2|_uni|_debian)(N) /dev/null)"}%%[# ]*}//,/ })' zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} zstyle ':completion:::::' completer _force_rehash _complete _approximate _expand _ignored +zstyle -e ':completion:*:approximate:*' max-errors 'reply=( $(( ($#PREFIX + $#SUFFIX) / 3 )) )' +zstyle ':completion:*:(^approximate):*' matcher-list 'm:{a-z}={A-Z}' bindkey -e bindkey 'e' backward-word @@ -65,7 +67,7 @@ precmd () { vcs_info setWindowTitle ${USER}@${HOST} - if [[ $UID == 0 && -f `which systemctl` ]] + if [[ $UID == 0 && $+commands[systemctl] != 0 ]] then use_systemd=true systemd_failed="`systemctl --state=failed | grep failed | cut -d \ -f 2 | tr '\n' ' '`" @@ -93,7 +95,7 @@ case "${DOMAIN//cs.fau.de/informatik.uni-erlangen.de}" in ;; esac -if [[ $UID == 0 && -f `which systemctl` ]] +if [[ $UID == 0 && $+commands[systemctl] != 0 ]] then PROMPT=$'%{$fg[red]>> $systemd_failed$reset_color%}\n' else