Skip to content

Instantly share code, notes, and snippets.

@diewland
Last active September 23, 2017 17:25
Show Gist options
  • Save diewland/596b05a716bf671cbfbb4fbcf1c2e97e to your computer and use it in GitHub Desktop.
Save diewland/596b05a716bf671cbfbb4fbcf1c2e97e to your computer and use it in GitHub Desktop.
My bashrc
# auto start tmux
if [[ ! $TERM =~ screen ]]; then
tmux a || tmux new
fi
# custom prompt
export PS1="\[\033[36m\]\u\[\033[33;1m\]\w\[\033[0;32m\]\$(__git_ps1 '(%s)') \[\033[36m\]\$\[\033[m\] "
### macos ###
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\[\033[36m\]\u\[\033[33;1m\]\w\[\033[0;32m\]\$(parse_git_branch '(%s)') \[\033[36m\]\$\[\033[m\] "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment