9 setopt HIST_EXPIRE_DUPS_FIRST
 
  10 setopt HIST_IGNORE_DUPS
 
  12 setopt HIST_REDUCE_BLANKS
 
  13 setopt HIST_SAVE_NO_DUPS
 
  14 setopt INC_APPEND_HISTORY
 
  25 # Disable bracketed paste mode
 
  26 unset zle_bracketed_paste
 
  29 if [[ "$TERM" = "dumb" ]]
 
  36 # Fallback to a more basic terminal type if necessary
 
  37 if [[ -z "${terminfo[cols]}" ]]
 
  40         xterm*) TERM="xterm";;
 
  47 # Make sure we know the username
 
  50     USER="$(id -un)"; export USER
 
  53 # Setup a default path
 
  54 PATH=".:${HOME}/bin:/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin"
 
  57 PAGER="less"; export PAGER
 
  58 LESS="aceiMRs"; export LESS
 
  61 EDITOR=/usr/bin/vi; export EDITOR
 
  62 VISUAL=/usr/bin/vi; export VISUAL
 
  65 HISTFILE=$HOME/.zshhistory
 
  69 # Ignore certain files when doing expansion
 
  74     xterm*) PROMPT="%{
\e]0;\${ENVIRONMENT:+\${ENVIRONMENT} on} %M
\a%}%m [%~] %# ";;
 
  75     screen*) PROMPT="%{
\ek\${ENVIRONMENT:+\${ENVIRONMENT} on} %M
\e\%}%m [%~] %# ";;
 
  76     *) PROMPT="%m [%~] %# ";;
 
  79 # Configure directory colours
 
  80 eval "$(/usr/bin/dircolors --sh ${HOME}/.dir_colors)"
 
  83 alias ls="ls -CFhv --color=auto"
 
  86 alias grep="grep --color=auto"
 
  87 alias egrep="egrep --color=auto"
 
  88 alias fgrep="fgrep --color=auto"
 
  89 alias cd="nocorrect cd"         # no spelling correction on cd
 
  90 alias mv="nocorrect mv"         # no spelling correction on mv
 
  91 alias cp="nocorrect cp"         # no spelling correction on cp
 
  92 alias mkdir="nocorrect mkdir"   # no spelling correction on mkdir
 
  93 alias man="nocorrect man"       # no spelling correction on man
 
  96 # Select the emacs key map
 
  99 # Bind various keys - hard code xterm bindings to match linux xterms
 
 104         bindkey "^[OA" history-beginning-search-backward
 
 105         bindkey "^[[A" history-beginning-search-backward
 
 106         bindkey "^[OB" history-beginning-search-forward
 
 107         bindkey "^[[B" history-beginning-search-forward
 
 108         bindkey "^[OH" beginning-of-line
 
 109         bindkey "^[OF" end-of-line
 
 110         bindkey "^[[2~" overwrite-mode
 
 111         bindkey "^[[3~" delete-char;;
 
 113         bindkey "${terminfo[kcuu1]}" history-beginning-search-backward
 
 114         bindkey "^[[A" history-beginning-search-backward
 
 115         bindkey "${terminfo[kcud1]}" history-beginning-search-forward
 
 116         bindkey "^[[B" history-beginning-search-forward
 
 117         bindkey "${terminfo[khome]}" beginning-of-line
 
 118         bindkey "${terminfo[kend]}" end-of-line
 
 119         bindkey "${terminfo[kich1]}" overwrite-mode
 
 120         bindkey "${terminfo[kdch1]}" delete-char;;
 
 123 # Configure completion
 
 124 zstyle ":completion:*" completer _complete _approximate
 
 125 zstyle ":completion:*" format "Completing %d"
 
 126 zstyle ":completion:*" group-name ""
 
 127 zstyle ":completion:*" menu select=long
 
 128 zstyle ":completion:*" rehash true
 
 129 zstyle ":completion:*" select-prompt "%SScrolling active: current selection at %p%s"
 
 135 # Autoload all local functions
 
 136 autoload ${HOME}/zshfuncs/*(:t)