Skip to content

Instantly share code, notes, and snippets.

@CBeloch
Created December 7, 2015 10:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CBeloch/53666c1ea1c226ec17a3 to your computer and use it in GitHub Desktop.
Save CBeloch/53666c1ea1c226ec17a3 to your computer and use it in GitHub Desktop.
My tuned .bash_profile for OS X
# Activate colors
export CLICOLOR='true'
export LSCOLORS="gxfxcxdxbxCgCdabagacad"
export EDITOR=vi
# Git branch in good-looking prompt.
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
# Prompt with Git branch
# "<Folder> <Git Branch> $ "
export PS1='\[$(tput setaf 3)\]\w\[$(tput setaf 1)\]$(parse_git_branch)\[$(tput sgr0)\] $ '
# Bonus track: SSH autocompleting hostnames, write ssh and press tab
complete -W "$(while read line; do echo ${line%%[, ]*}; done < ~/.ssh/known_hosts)" ssh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment