export PS1='$USER@${HOSTNAME%%.*}:$PWD '

alias md='mkdir -p'
alias rd=rmdir
alias cls=clear
alias o='p4 opened ...'

# Add 'p4h' help alias to pipe pages of help docs to 'less', a popular pager.
# Sample Usage:  p4h dvcs
function p4h () { p4 help "$*" | less; }

[[ -r /p4/common/bin/p4_vars ]] && source /p4/common/bin/p4_vars EDITME_SDP_INSTANCE

#------------------------------------------------------------------------------
# Independent per-terminal session command history.  Over time, this will
# create a number of history files that can be cleaned with a command like
# this sample, which removes all shell history files over a year old.
# $ find ~/.hist -type f -mtime +365 -exec rm -f {} \;
#------------------------------------------------------------------------------
export HISTFILESIZE=5000
export HISTTIMEFORMAT="%Y/%m/%d %Z %H:%M:%S "

# Set per-shell history files stored in ~/.hist unless HISTFILE is readonly.
if [[ -z "$(readonly | grep HISTFILE 2>/dev/null)" ]]; then
   [[ ! -d ~/.hist ]] && mkdir ~/.hist
   export HISTFILE=~/.hist/history.$$.$RANDOM
fi

# If you invoke command completion with a path that references a shell variable,
# by default the command completion injects an annoying backslash in front of
# the '$' character, thus breaking the completion.  For example, if you type
# 'ls $LOGS/p4' and hit Tab to invoke command completion, it'll get a leading
# backslash to become '\$LOGS/p4', and the completion no longer works.  The
# 'shopt -s direxpand' disables expansion, which fixes this problem.  When you
# hit the tab, $LOGS will get expanded the directory, e.g. '/p4/1/logs', and
# you the expansion will be '/p4/1/logs/p4', and the tab completion will then
# work as expected.
shopt -s direxpand