From: Nick Bowler Date: Thu, 21 Jan 2010 19:02:40 +0000 (-0500) Subject: zshrc: Cleanup. X-Git-Url: https://git.draconx.ca/gitweb/zshconf.git/commitdiff_plain/444e9cc97af7f2644efc56409365f19d3ffe89e4 zshrc: Cleanup. Remove unnecessary quoting, use zsh-isms consistently. --- diff --git a/zshrc b/zshrc index f1a3191..899be85 100644 --- a/zshrc +++ b/zshrc @@ -1,16 +1,16 @@ -if [ -n "$HOME" ]; then - HISTFILE="$HOME/.zsh_history" +if [[ -n $HOME ]]; then + HISTFILE=$HOME/.zsh_history SAVEHIST=1000 fi HISTSIZE=1000 bindkey -e -case "$TERM" in +case $TERM in rxvt*) - if [ "$TERM" = "rxvt-unicode" ]; then - [ -z "$COLORTERM" ] && export COLORTERM="rxvt-xpm" - [ -z "$COLORFGBG" ] && export COLORFGBG="15;default;0" + if [[ $TERM == rxvt-unicode ]]; then + [[ -z $COLORTERM ]] && export COLORTERM='rxvt-xpm' + [[ -z $COLORFGBG ]] && export COLORFGBG='15;default;0' fi bindkey '\e[3~' delete-char @@ -24,15 +24,15 @@ screen*|linux) ;; xterm) bindkey '\e[3~' delete-char - bindkey '\e[F' end-of-line - bindkey '\e[H' beginning-of-line - bindkey '\eOH' beginning-of-line - bindkey '\eOF' end-of-line + bindkey '\e[F' end-of-line + bindkey '\e[H' beginning-of-line + bindkey '\eOH' beginning-of-line + bindkey '\eOF' end-of-line ;; esac # Set the xterm title -case "$TERM" in +case $TERM in xterm*|rxvt*|Eterm|aterm|kterm|gnome*) settitle() { print -Pn $'\e]0;%n@%m %33<...<%~%<<\a' } ;; @@ -44,11 +44,12 @@ case "$TERM" in ;; esac +# Show the return code of failed commands, but don't be noisy about it. precmd() { settitle - if [[ -n "$__NEWRUN" ]]; then - RPS1=$'%(0?,,%{\e[31;1m%}RC=%?%{\e[0m%})' + if [[ -n $__NEWRUN ]]; then + RPS1='%(0?,,%B%F{red}RC=%?%f%b)' unset __NEWRUN else unset RPS1 @@ -60,15 +61,15 @@ preexec() { } # A gentoo-like prompt. -PS1=$'%B%(!,%F{red},%F{green}%n@)%m %F{blue}%33<...<%~%<< %#%f%b ' +PS1='%B%(!,%F{red},%F{green}%n@)%m %F{blue}%33<...<%~%<< %#%f%b ' -if [ -n "$COLORTERM" ]; then - # Random colour-related options +if [ -n $COLORTERM ]; then + # Assorted colour-related options export MINICOM="-c on" fi -if [[ -n "$SSH_CONNECTION" ]]; then - PS1="${PS1/green/yellow}" +if [[ -n $SSH_CONNECTION ]]; then + PS1=${PS1/green/yellow} fi # Locale