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" ]]
 
  34 # Fallback to a more basic terminal type if necessary
 
  35 if [[ -z "${terminfo[cols]}" ]]
 
  38         xterm*) TERM="xterm";;
 
  45 # Make sure we know the username
 
  48     USER="$(id -un)"; export USER
 
  51 # Setup a default path
 
  52 PATH=".:${HOME}/bin:/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin"
 
  55 PAGER="less"; export PAGER
 
  56 LESS="aceiMRs"; export LESS
 
  59 EDITOR=/usr/bin/vi; export EDITOR
 
  60 VISUAL=/usr/bin/vi; export VISUAL
 
  63 HISTFILE=$HOME/.zshhistory
 
  67 # Ignore certain files when doing expansion
 
  72     xterm*) PROMPT="%{
\e]0;\${ENVIRONMENT:+\${ENVIRONMENT} on} %M
\a%}%m [%~] %# ";;
 
  73     screen*) PROMPT="%{
\ek\${ENVIRONMENT:+\${ENVIRONMENT} on} %M
\e\%}%m [%~] %# ";;
 
  74     *) PROMPT="%m [%~] %# ";;
 
  77 # Configure directory colours
 
  78 eval "$(/usr/bin/dircolors --sh ${HOME}/.dir_colors)"
 
  81 alias ls="ls -CFhv --color=auto"
 
  84 alias grep="grep --color=auto"
 
  85 alias egrep="egrep --color=auto"
 
  86 alias fgrep="fgrep --color=auto"
 
  87 alias cd="nocorrect cd"         # no spelling correction on cd
 
  88 alias mv="nocorrect mv"         # no spelling correction on mv
 
  89 alias cp="nocorrect cp"         # no spelling correction on cp
 
  90 alias mkdir="nocorrect mkdir"   # no spelling correction on mkdir
 
  91 alias man="nocorrect man"       # no spelling correction on man
 
  94 # Select the emacs key map
 
  97 # Bind various keys - hard code xterm bindings to match linux xterms
 
 102         bindkey "^[OA" history-beginning-search-backward
 
 103         bindkey "^[[A" history-beginning-search-backward
 
 104         bindkey "^[OB" history-beginning-search-forward
 
 105         bindkey "^[[B" history-beginning-search-forward
 
 106         bindkey "^[OH" beginning-of-line
 
 107         bindkey "^[OF" end-of-line
 
 108         bindkey "^[[2~" overwrite-mode
 
 109         bindkey "^[[3~" delete-char;;
 
 111         bindkey "${terminfo[kcuu1]}" history-beginning-search-backward
 
 112         bindkey "^[[A" history-beginning-search-backward
 
 113         bindkey "${terminfo[kcud1]}" history-beginning-search-forward
 
 114         bindkey "^[[B" history-beginning-search-forward
 
 115         bindkey "${terminfo[khome]}" beginning-of-line
 
 116         bindkey "${terminfo[kend]}" end-of-line
 
 117         bindkey "${terminfo[kich1]}" overwrite-mode
 
 118         bindkey "${terminfo[kdch1]}" delete-char;;
 
 121 # Configure completion
 
 122 zstyle ":completion:*" completer _complete _approximate
 
 123 zstyle ":completion:*" format "Completing %d"
 
 124 zstyle ":completion:*" group-name ""
 
 125 zstyle ":completion:*" menu select=long
 
 126 zstyle ":completion:*" rehash true
 
 127 zstyle ":completion:*" select-prompt "%SScrolling active: current selection at %p%s"
 
 133 # Autoload all local functions
 
 134 autoload ${HOME}/zshfuncs/*(:t)