- function to quickly look at the documentation for a package, complete with tab completion:
# Function Usage: doc packagename
# doc pac
doc() { cd /usr/share/doc/$1 && ls }
_doc() { _files -W /usr/share/doc -/ }
compdef _doc doc
- automatically updates the xterm titlebar with the current directory name:
case $TERM in
xterm*)
## Run when the PWD is changed. Put the PWD in the title of the xterm.
function precmd {
print -Pn "\033]2; %n@%m - %~\007"
}
;;
esac