+### hooks
+local _exectime=
+function precmd {
+ # change terminal title
+ print -Pn "\e]2;%(1j,%j,)%#${SSH_CLIENT+$USER@$HOST:}%~\e\\"
+ # update vcs
+ vcs_info
+ # bell if exec takes 5s
+ if ((SECONDS - _exectime >= 5)) print "\a"
+}
+function preexec {
+ # change terminal title to show command
+ print -Pnf "\e]2;%s\e\\" "%#${SSH_CLIENT+$USER@$HOST:}$1"
+ # save last exec time for bell
+ _exectime=$SECONDS
+}
+function chpwd {
+ l
+}
+
+### system-specific configs and aliases
+case "$OSTYPE"; in
+ freebsd*)
+ ## vt binds
+ bindkey "^[[H" beginning-of-line #Home
+ bindkey -a "^[[H" beginning-of-line
+ bindkey "^[[F" end-of-line #End
+ bindkey -a "^[[F" end-of-line