# Search path for the cd commandcdpath=(.. ~ ~/src ~/zsh)# Use hard limits, except for a smaller stack and no core dumpsunlimitlimit stack 8192limit core 0limit -sumask 022# Set up aliasesalias mv='nocorrect mv' # no spelling correction on mvalias cp='nocorrect cp' # no spelling correction on cpalias mkdir='nocorrect mkdir' # no spelling correction on mkdiralias j=jobsalias pu=pushdalias po=popdalias d='dirs -v'alias h=historyalias ls='ls --color=auto'alias ll='ls -l'alias la='ls -A'alias trelew='ssh trelew'alias athlon='ssh athlon'alias logistica='ssh logistica'# Atajosalias ag=apt-getalias ac=apt-cachealias agr='apt-get remove'alias acs="apt-cache search"alias agi="apt-get install"alias igrep="grep -i"alias la="ls -lA"alias td="todo"alias motd="cat /etc/motd"# Disable ctrl-sstty -ixon# List only directories and symbolic# links that point to directoriesalias lsd='ls -ld *(-/DN)'# List only file beginning with "."alias lsa='ls -ld .*'# Shell functionssetenv() { typeset -x "${1}${1:+=}${(@)argv[2,$#]}" } # csh compatibilityfreload() { while (( $# )); do; unfunction $1; autoload -U $1; shift; done }# Where to look for autoloaded function definitionsfpath=($fpath ~/.zfunc)# Autoload all shell functions from all directories in $fpath (following# symlinks) that have the executable bit on (the executable bit is not# necessary, but gives you an easy way to stop the autoloading of a# particular shell function). $fpath should not be empty for this to work.for func in $^fpath/*(N-.x:t); autoload $func# automatically remove duplicates from these arraystypeset -U path cdpath fpath # Global aliases -- These do not have to be# at the beginning of the command line.alias -g L='|less'alias -g H='|head'alias -g T='|tail'# Some environment variablesexport MAIL=/var/spool/mail/$USERNAMEexport LESS=-cex3Mexport HELPDIR=/usr/local/lib/zsh/help # directory for run-help function to find docsfor i in ~/Mail/[^.]*do MAILPATH=$MAILPATH:$i'?You have new mail in your ${_##*/} folder'doneexport MAILPATHunset iMAILCHECK=300HISTSIZE=200DIRSTACKSIZE=20# Watch for my friends#watch=( $(<~/.friends) ) # watch for people in .friends filewatch=(notme) # watch for everybody but meLOGCHECK=300 # check every 5 min for login/logout activityWATCHFMT='%n %a %l from %m at %t.'# Set/unset shell optionssetopt notify globdots correct pushdtohome cdablevars autolistsetopt correctall autocd recexact longlistjobssetopt autoresume histignoredups pushdsilent noclobbersetopt autopushd pushdminus extendedglob rcquotes mailwarningunsetopt bgnice autoparamslash# Autoload zsh modules when they are referencedzmodload -a zsh/stat statzmodload -a zsh/zpty zptyzmodload -a zsh/zprof zprofzmodload -ap zsh/mapfile mapfilebindkey -e # emacs key bindings#--------------------------------------------------# bindkey ' ' magic-space # also do history expansion on space#-------------------------------------------------- #--------------------------------------------------# bindkey '^I' complete-word # complete on tab, leave expansion to _expand#-------------------------------------------------- # Setup new style completion system. To see examples of the old style (compctl# based) programmable completion, check Misc/compctl-examples in the zsh# distribution.autoload -U compinitcompinit# Completion Styles# list of completers to usezstyle ':completion:*::::' completer _expand _complete _ignored _approximate# allow one error for every three characters typed in approximate completerzstyle -e ':completion:*:approximate:*' max-errors \ 'reply=( $(( ($#PREFIX+$#SUFFIX)/3 )) numeric )'# insert all expansions for expand completerzstyle ':completion:*:expand:*' tag-order all-expansions# formatting and messageszstyle ':completion:*' verbose yeszstyle ':completion:*:descriptions' format '%B%d%b'zstyle ':completion:*:messages' format '%d'zstyle ':completion:*:warnings' format 'No matches for: %d'zstyle ':completion:*:corrections' format '%B%d (errors: %e)%b'zstyle ':completion:*' group-name ''# match uppercase from lowercasezstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'# offer indexes before parameters in subscriptszstyle ':completion:*:*:-subscript-:*' tag-order indexes parameters# command for process lists, the local web server details and host completion#zstyle ':completion:*:processes' command 'ps -o pid,s,nice,stime,args'#zstyle ':completion:*:urls' local 'www' '/var/www/htdocs' 'public_html'zstyle '*' hosts $hosts# Filename suffixes to ignore during completion (except after rm command)zstyle ':completion:*:*:(^rm):*:*files' ignored-patterns '*?.o' '*?.c~' \ '*?.old' '*?.pro'# the same for old style completion#fignore=(.o .c~ .old .pro)# ignore completion functions (until the _ignored completer)zstyle ':completion:*:functions' ignored-patterns '_*'# name directoriesnamedir() { export $1=$PWD; : ~$1 }# don't put duplicate lines in the history. See bash(1) for more optionsexport HISTCONTROL=ignoredupsexport HISTIGNORE="&:ls:ls *:mutt:[bf]g:exit"PROMPT=$'%{\e[1;32m%}%n@%m%{\e[0m%}:%{\e[1;34m%}%~>%{\e[0m%} '# make less more friendly for non-text input files, see lesspipe(1)[ -x /usr/bin/lesspipe ] && eval "$(lesspipe)"# set variable identifying the chroot you work in (used in the prompt below)if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then debian_chroot=$(cat /etc/debian_chroot)fi# Load local settingsif test -e ~/.zshrc_local; then source ~/.zshrc_local; fi