X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=zsh%2Frc;h=1a8c7994fd4abdee7d25bb6507d03060f7c0137a;hb=ae9b1f3d4fe45783c93439647753c1273e0a44b2;hp=0cb114d5d2f8fc844a683bf45cd07e78ec480c29;hpb=31ba983543edee7aac65d0fad181086011bd292f;p=config%2Fdotfiles.git diff --git a/zsh/rc b/zsh/rc index 0cb114d..1a8c799 100644 --- a/zsh/rc +++ b/zsh/rc @@ -865,11 +865,15 @@ fi command tig --max-count=200 --branches --remotes --tags "$@" } -# Choose the "best" PDF viewer available: xpdf, then zathura (in the past -# zathura was preferred, but recent versions are completely broken: still no -# working search and no page-wise scrolling anymore). Also setup completion -# for `pdf`. -if (( $+commands[xpdf] )); then +# Choose the "best" PDF viewer available. Also setup completion for `pdf`. +if (( $+commands[katarakt] )); then + pdf() { + command katarakt "$@" 2>/dev/null & + disown %command + } + # No completion for katarakt yet. + compdef pdf=xpdf +elif (( $+commands[xpdf] )); then pdf() { command xpdf "$@" 2>/dev/null & disown %command @@ -975,7 +979,7 @@ if [[ $LD_PRELOAD != *libcoloredstderr.so* ]]; then # process when starting GNU screen/tmux (see above). else exec 2>>(while read -r -k -u 0 line; do - printf '\e[91m%s\e[0m' "$line" + printf '\e[91m%s\e[0m' $line print -n $'\0' done &) fi @@ -1023,7 +1027,7 @@ zshrc_restart_precmd() { fi local startup - strftime -s startup '%Y-%m-%d %H:%M:%S' "$zshrc_startup_time" + strftime -s startup '%Y-%m-%d %H:%M:%S' $zshrc_startup_time echo -n "${fg[magenta]}" echo -n "~/.zshrc modified since startup ($startup) ... " @@ -1045,9 +1049,9 @@ zshrc_restart_precmd() { # Don't kill our current session by execing it. zsh -i -c 'exit 42' if [[ $? -ne 42 ]]; then - echo -n "${fg_bold[red]}" + echo -n ${fg_bold[red]} echo 'failed to start new zsh!' - echo -n "${fg_bold[default]}" + echo -n ${fg_bold[default]} return fi