Skip to content

Instantly share code, notes, and snippets.

@juliantrueflynn
Created July 7, 2019 23:33
Show Gist options
  • Save juliantrueflynn/434ecf880496357f4fa4b256d035c089 to your computer and use it in GitHub Desktop.
Save juliantrueflynn/434ecf880496357f4fa4b256d035c089 to your computer and use it in GitHub Desktop.
Bash scripts I use for Macbooks
# Get current git branch name
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
# Format Terminal input prefix
export PS1="\W\[\033[32m\]\$(parse_git_branch)\[\033[00m\] $ "
# Load RVM into a shell session *as a function*
[[ -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