commit fad03e8e4152f335d7fae46a2ccab0a145a93152 Author: Haak Saxberg Date: Wed Aug 15 00:33:15 2012 -0400 on the road\! diff --git a/bash/bash_profile b/bash/bash_profile new file mode 100644 index 0000000..c5aef31 --- /dev/null +++ b/bash/bash_profile @@ -0,0 +1,3 @@ +if [ -f ~/.bashrc ]; then + source ~/.bashrc; +fi diff --git a/bash/bashrc b/bash/bashrc new file mode 100644 index 0000000..d47a3f1 --- /dev/null +++ b/bash/bashrc @@ -0,0 +1,97 @@ +# 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 ls='ls --color=auto' + #alias dir='dir --color=auto' + #alias vdir='vdir --color=auto' + + alias grep='grep --color=auto' + alias fgrep='fgrep --color=auto' + alias egrep='egrep --color=auto' +fi + +# 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 + + +if [ -f /opt/local/etc/bash_completion ]; then + . /opt/local/etc/bash_completion.d/git + export GIT_PS1_SHOWDIRTYSTATE=1 + export GIT_PS1_SHOWUPSTREAM=auto +fi + +if [ -f ~/.git-flow-completion.bash ]; then + . ~/.git-flow-completion.bash +fi + +#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] +> "