+### path
+# typeset -U makes every array entry unique; /usr/{pkg,local} are bsdisms
+typeset -U path
+path=({~/,/,/usr/}sbin {~/,/,/usr/}bin /usr/pkg/{s,}bin /usr/X11R{7,6}/bin
+ /usr/local/{s,}bin $path)
+
+### history
+setopt appendhistory
+HISTFILE=~/.histfile
+HISTSIZE=100
+SAVEHIST=100
+
+### keys
+bindkey -v
+KEYTIMEOUT=1
+## xorg
+bindkey "^[[7~" beginning-of-line #Home
+bindkey -a "^[[7~" beginning-of-line
+bindkey "^[[8~" end-of-line #End
+bindkey -a "^[[8~" end-of-line
+bindkey "^[[3~" delete-char #Del
+bindkey -a "^[[3~" delete-char
+## history search
+autoload -Uz up-line-or-beginning-search down-line-or-beginning-search
+zle -N up-line-or-beginning-search
+zle -N down-line-or-beginning-search
+[[ -n "$key[Up]" ]] && bindkey -- "$key[Up]" up-line-or-beginning-search
+[[ -n "$key[Down]" ]] && bindkey -- "$key[Down]" down-line-or-beginning-search
+
+### aliases
+alias h="history -25"
+alias j="jobs -l"
+alias l="ls -AF"
+alias ll="ls -lAFho"
+## ps
+local p="ps -aSdxwwouser=USR -ogroup=GRP -opid,nice=N \
+ -o%cpu,%mem,tt,stat,start=START -oetime,command | ${PAGER:-more} -Se"
+alias pa="$p"
+alias spa="sudo $p"
+unset p
+## py venv
+alias va="source bin/activate"
+alias vd="deactivate"
+## be paranoid
+alias cp='cp -ip'
+alias mv='mv -i'
+if [[ "$OSTYPE" = "freebsd" ]] {
+ # don't confirm if only a few files are deleted
+ alias rm='rm -I'
+} else {
+ alias rm='rm -i'