Created
July 19, 2013 16:22
-
-
Save ethnt/6040456 to your computer and use it in GitHub Desktop.
OS X bash profile. These are the very basics, without much configuration.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
### .bash_profile | |
### | |
export PATH=/usr/local/bin:$PATH | |
# Get the aliases | |
source /Users/ethan/.bash_aliases | |
# Enable colors on the command line | |
export CLICOLORS=1 | |
# Add ~/.bin to $PATH | |
export PATH=$PATH:/Users/ethan/.bin | |
# Set TTY. | |
if `tty -s`; then | |
mesg n | |
fi | |
# Colored CLI prompt | |
GREEN="\[\033[0;32m\]" | |
BLUE="\[\033[0;36m\]" | |
WHITE="\[\033[0;37m\]" | |
export PS1="$GREEN\h:$BLUE\W$WHITE\$(parse_git_branch)\$ " | |
# Git helpers | |
function parse_git_dirty { | |
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*" | |
} | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1]/" | |
} | |
# Git completion | |
source /usr/local/git-completion.bash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment