Skip to content

Instantly share code, notes, and snippets.

@gvieira
Last active December 20, 2015 18:28
Show Gist options
  • Save gvieira/6175883 to your computer and use it in GitHub Desktop.
Save gvieira/6175883 to your computer and use it in GitHub Desktop.
I love zsh, but bash keeps things simpler. You can add it directly to .bash_profile or create a new file and source it in .bash_profile. References: - For git branch, the internet! - For prompt, https://github.com/sindresorhus/pure. - For theme, https://github.com/chriskempson/tomorrow-theme.
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$(parse_git_dirty)/"
}
export PS1='\[\033[34m\]\w \[\033[1;30m\]$(parse_git_branch)\[\033[0m\]\n\[\033[1;35m\]❯ \[\033[0m\]'
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
alias ls='ls -G'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment