function precmd {
print -Pn "\e]0;${SSH_CLIENT+$USER@$HOST}%#zsh%(1j,:%j,):%~\a"
vcs_info
+ if ((SECONDS - _exectime >= 5)) {
+ # bell after long exec
+ print "\a"
+ }
}
function preexec {
printf "\033]0;%s\a" "$1"
+ _exectime=$SECONDS
}
# prompt
alias activate="source bin/activate"
# ports
-alias pbuild="sudo pkg install --automatic \`make build-depends-list | sed 's/\/usr\/ports\// /' | tr -d '\n'\`"
-alias prun="sudo pkg install --automatic \`make run-depends-list | sed 's/\/usr\/ports\// /' | tr -d '\n'\`"
+function portpkg {
+ case "$1" {
+ build|run) ;;
+ *)
+ echo "Usage: \`portpkg <build|run>' in a port directory"
+ return 1;;
+ }
+ sudo pkg install -AU $(make ${1}-depends-list | sed 's_/usr/ports/_ _' | tr -d '\n')
+}
# keys
bindkey "^[[7~" beginning-of-line #Home