# Andrew McNabb's zshrc # Load compatible rc file (for aliases and variables) if [[ $ZDOTDIR == "" ]] then export ZDOTDIR="$HOME" fi . $ZDOTDIR/.shrc # Vi mode: bindkey -v #Set erase and kill to defaults: stty ek # Prompt: username@host:/cwd% PROMPT='%n@%m:%25<+<%~%<<%# ' # Right-prompt: display frown when a command returns an error code RPROMPT='%(?..:()' # Make su keep my zsh settings: if [[ `grep ^root: /etc/passwd |cut -d: -f7` != "/bin/zsh" ]] then function su() { su="$(whence -p su)" if [[ $1 == "" || $1 == root ]] then $su -c /bin/zsh elif [[ $1 == - ]] then $su - else $su "$1" -c /bin/zsh fi } fi # Automatically decide when to page a list of completions LISTMAX=0 # see "man zshoptions" to see all possible options ############################################################################## # Changing Directories # Make cd push the old directory onto the directory stack. setopt auto_pushd # Don’t push multiple copies of the same directory onto the directory stack. setopt pushd_ignore_dups ############################################################################## # Completion # Allow tab completion in the middle of a word setopt complete_in_word # Completion within a word moves to the end of the word setopt always_to_end # Display a menu, even when there's an unambiguous prefix unsetopt list_ambiguous # Try to make the completion list smaller setopt list_packed ############################################################################## # Expansion and Globbing # Sort filenames numerically when it makes sense. setopt numeric_glob_sort ############################################################################## # History # Do not enter command lines into the history list if they are duplicates of # the previous event. setopt hist_ignore_dups # Remove superfluous blanks from each command line setopt hist_reduce_blanks # For history expansion, load the line into the buffer instead of executing setopt hist_verify ############################################################################## # Input/Output # Correct misspelled commands #setopt correct # Use Dvorak keyboard for correcting mistakes setopt dvorak # Turn off ^S and ^Q nonsense unsetopt flow_control # Do not exit on end-of-file (^D). setopt ignore_eof # Allow comments even in interactive shells setopt interactive_comments # Turn off all beeping unsetopt beep # If I say rm *, I mean it setopt rm_star_silent ############################################################################## # Job Control # Automatically restart a job after disowning it setopt auto_continue # Report the status of background jobs immediately setopt notify ############################################################################## # Completion: autoload -U compinit compinit -D