Skip to content

Instantly share code, notes, and snippets.

@JosephKu
Last active September 13, 2016 15:20
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save JosephKu/1131393 to your computer and use it in GitHub Desktop.
Save JosephKu/1131393 to your computer and use it in GitHub Desktop.
Bash profile file for Mac OS X
# .profile for Bash on Mac OS X
#
# Written by Joseph Ku <chiehfang.ku@gmail.com>
# All right reserved.
# 'ls' with colors
export CLICOLOR=1
#export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx
#export LSCOLORS=ExxxxxDxBxegedabxxacad
export LSCOLORS=ExFxCxDxBxegedabagacad
# Display color man pages
export PAGER="most"
# Prompt
export PS1="[\[\033[1;33m\]\u\[\033[0m\]:\[\033[1;32m\]\W\[\033[0m\]]\$(parse_git_branch)$ "
# Git diff
function git_diff() {
git diff --no-ext-diff -w "$@" | vim -R -
}
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
# HomeBrew
export PATH=$HOME/bin:/usr/local/bin:/usr/local/sbin:$PATH
# MacPorts
# export PATH=$HOME/bin:/opt/local/bin:/opt/local/sbin:$PATH
# HomeBrew::Bash Completion
if [ -f `brew --prefix`/etc/bash_completion ]; then
. `brew --prefix`/etc/bash_completion
fi
# MacPorts::Bash Completion
#if [ -f /opt/local/etc/bash_completion ]; then
# . /opt/local/etc/bash_completion
#fi
# Load RVM into a shell session.
# Note: Place this line at the bottom to make sure that the Ruby we launch is from RVM
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment