dotfiles/bash/bashrc

97 lines
2.9 KiB
Bash
Raw Normal View History

2012-08-15 00:33:15 -04:00
# 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_branch () {
git name-rev HEAD 2> /dev/null | sed 's#HEAD\ \(.*\)# (git::\1)#'
}
parse_svn_branch() {
parse_svn_url | sed -e 's#^'"$(parse_svn_repository_root)"'##g' | awk '{print " (svn::"$1")" }'
}
parse_svn_url() {
svn info 2>/dev/null | sed -ne 's#^URL: ##p'
}
parse_svn_repository_root() {
svn info 2>/dev/null | sed -ne 's#^Repository Root: ##p'
}
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
2012-08-15 01:10:45 -04:00
alias ls='ls --color=auto'
alias grep='grep --color'
alias fgrep='fgrep --color'
alias egrep='egrep --color'
2012-08-15 00:33:15 -04:00
# MacPorts Installer addition on 2012-07-11_at_04:34:47: adding an appropriate PATH variable for use with MacPorts.
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
# Finished adapting your PATH environment variable for use with MacPorts.
alias vim='mvim -v'
function ll(){ ls -lhF "$@"| egrep "^d" ; ls -lXB "$@" 2>&-| \
egrep -v "^d|total "; }
alias ls="ls -hF"
alias la='ls -Al' # show hidden files
alias lx='ls -lXB' # sort by extension
alias lk='ls -lSr' # sort by size, biggest last
alias lc='ls -ltcr' # sort by and show change time, most recent last
alias lu='ls -ltur' # sort by and show access time, most recent last
alias lt='ls -ltr' # sort by date, most recent last
alias lm='ls -al |more' # pipe through 'more'
alias lr='ls -lR' # recursive ls
alias tree='tree -Csu' # nice alternative to 'recursive ls'
alias mkdir='mkdir -p'
# aliases
alias cd..="cd .."
alias l="ls -al"
alias lp="ls -p"
alias h=history
# the "kp" alias ("que pasa"), in honor of tony p.
alias kp="ps auxwww"
alias ss="/System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine -background &"
# general path munging
PATH=${PATH}:~/bin
PATH=${PATH}:/usr/local/bin
# postgres
export PATH=${PATH}:/usr/local/pgsql/bin
export PGDATA=/usr/local/pgsql/data
2012-08-15 01:10:45 -04:00
if [ -f /opt/local/etc/bash_completion.d/git ]; then
source /opt/local/etc/bash_completion.d/git
2012-08-15 00:33:15 -04:00
export GIT_PS1_SHOWDIRTYSTATE=1
export GIT_PS1_SHOWUPSTREAM=auto
fi
2012-08-15 01:10:45 -04:00
source ~/.git-flow-completion.bash
2012-08-15 00:33:15 -04:00
#export PS1="$BLACK[ \u@$RED\h $GREEN\w$RED_BOLD\$(parse_git_branch)\$(parse_svn_branch)$BLACK ] "
# configure my multi-line prompt
export PS1="
$BLACK[ \u@$RED\h $GREEN\w$RED_BOLD\$(parse_svn_branch)\$(__git_ps1 \" (%s)\") $BLACK]
> "