Skip to content

Instantly share code, notes, and snippets.

@sandrods
Created July 27, 2011 18:05
Show Gist options
  • Save sandrods/1110002 to your computer and use it in GitHub Desktop.
Save sandrods/1110002 to your computer and use it in GitHub Desktop.
my Mac env
alias ll='ls -l'
alias 'cd..'='cd ..'
export DYLD_LIBRARY_PATH="/opt/oracle/instantclient_10_2"
export SQLPATH="/opt/oracle/instantclient_10_2"
export TNS_ADMIN="/opt/oracle/network/admin"
export NLS_LANG="AMERICAN_AMERICA.UTF8"
export PATH=$PATH:$DYLD_LIBRARY_PATH
source ~/.git-completion.bash
PS1="\[\033];\u:\w\007\]\u: [\w] \$(__git_ps1 '(%s) ')\$ "
export LS_OPTIONS='--color=auto'
export CLICOLOR='Yes'
export LSCOLORS=''
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function
function _git_prompt() {
local git_status="`git status -unormal 2>&1`"
if ! [[ "$git_status" =~ Not\ a\ git\ repo ]]; then
if [[ "$git_status" =~ nothing\ to\ commit ]]; then
local ansi=42
elif [[ "$git_status" =~ nothing\ added\ to\ commit\ but\ untracked\ files\ present ]]; then
local ansi=43
else
local ansi=45
fi
if [[ "$git_status" =~ On\ branch\ ([^[:space:]]+) ]]; then
branch=${BASH_REMATCH[1]}
test "$branch" != master || branch=' '
else
# Detached HEAD. (branch=HEAD is a faster alternative.)
branch="(`git describe --all --contains --abbrev=4 HEAD 2> /dev/null ||
echo HEAD`)"
fi
echo -n '\[\e[0;37;'"$ansi"';1m\]'" $branch "'\[\e[0m\] '
fi
}
function _prompt_command() {
PS1="`_git_prompt`\[\033[01;34m\]\$(~/.rvm/bin/rvm-prompt)"'\[\033];\u:\w\007\] [\w] '
}
PROMPT_COMMAND=_prompt_command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment