Skip to content

Instantly share code, notes, and snippets.

@wolf81
Last active March 9, 2020 01:36
Show Gist options
  • Select an option

  • Save wolf81/50519fc6bfcd001c728f674789ba580c to your computer and use it in GitHub Desktop.

Select an option

Save wolf81/50519fc6bfcd001c728f674789ba580c to your computer and use it in GitHub Desktop.
My macOS .bash_profile
# Read .bashrc file if it exists
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
# Add syntax coloring for less, relies on the source-highlight homebrew formula
LESSPIPE=`which src-hilite-lesspipe.sh`
export LESSOPEN="| ${LESSPIPE} %s"
export LESS=' -R -X -F '
# Git branch parsing
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
# Improve prompt layout & show git branch
export PS1="\u@\h \W\[\033[32m\]\$(parse_git_branch)\[\033[00m\] $ "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment