pd() {
if [[ $# -eq 0 ]] ; then
popd
+ elif [[ $# -eq 1 && $1 == "--" ]] ; then
+ dirs -v
else
pushd "$@"
fi
}
+cd_history() {
+ if [[ $# -eq 1 ]] ; then
+ case $1 in
+ -h)
+ command dirs "$1" |& tail -1
+ command cd "$1" |& tail -1
+ return
+ ;;
+ --help)
+ command dirs "$1"
+ command cd "$1"
+ return
+ ;;
+ -[clpv])
+ command dirs "$1"
+ return
+ ;;
+ -[0-9]*)
+ set -- "$(dirs "+${1:1}")"
+ ;;
+ esac
+ fi
+ if command cd "$@" ; then
+ pushd -n "${PWD}" >/dev/null
+ fi
+}
+alias cd='cd_history'
+
if [[ ${TERM} != "dumb" ]] ; then
export GREP_COLORS=ne #470810
alias grep='grep --colour=auto -d skip'