# don't put duplicate lines in the history. See bash(1) for more options # ... or force ignoredups and ignorespace HISTCONTROL=ignoredups:ignorespace # append to the history file, don't overwrite it shopt -s histappend # check the window size after each command and, if necessary, # update the values of LINES and COLUMNS. shopt -s checkwinsize parse_git_dirty() { [[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "(*)" } parse_git_stash() { [[ $(git stash list 2> /dev/null | tail -n1) != "" ]] && echo "(^)" } parse_git_branch () { git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1/" } BLACK="\[\033[0;38m\]" RED="\[\033[0;31m\]" RED_BOLD="\[\033[01;31m\]" BLUE="\[\033[01;34m\]" GREEN="\[\033[0;32m\]" export CLICOLOR=1 export EDITOR=/usr/bin/mvim if [ -x /usr/bin/dircolors ]; then test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" #alias dir='dir --color=auto' #alias vdir='vdir --color=auto' fi alias grep='grep --color' alias fgrep='fgrep --color' alias egrep='egrep --color' alias vim='~/local/bin/vim' function ll(){ ls -lhF --color=auto "$@"| egrep "^d" ; ls -lXB "$@" 2>&-| \ egrep -v "^d|total "; } alias ls="ls -hF --color=auto" alias la='ls -Al --color=auto' # show hidden files alias lx='ls -lXB --color=auto' # sort by extension alias lk='ls -lSr --color=auto' # sort by size, biggest last alias lc='ls -ltcr --color=auto' # sort by and show change time, most recent last alias lu='ls -ltur --color=auto' # sort by and show access time, most recent last alias lt='ls -ltr --color=auto' # sort by date, most recent last alias lm='ls -al --color=auto | more' # pipe through 'more' alias lr='ls -lR --color=auto' # recursive ls alias tree='tree -Csu' # nice alternative to 'recursive ls' alias mkdir='mkdir -p' # aliases alias cd..="cd .." alias lp="ls -p --color=auto" alias h=history # the "kp" alias ("que pasa"), in honor of tony p. alias kp="ps auxwww" # general path munging PATH=${PATH}:~/bin PATH=${PATH}:/usr/local/bin if [ -f /opt/local/etc/bash_completion.d/git ]; then source /opt/local/etc/bash_completion.d/git export GIT_PS1_SHOWDIRTYSTATE=1 export GIT_PS1_SHOWUPSTREAM=auto fi # configure my multi-line prompt export PS1=" $BLACK[ \u@$RED\h $GREEN\w $RED_BOLD{ \$(parse_git_branch) \$(parse_git_dirty)\$(parse_git_stash) } $BLACK] > "