Created
June 10, 2017 23:03
-
-
Save rightson/aa7da94fd7735accec95372ed36bb3a6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# from https://stackoverflow.com/questions/1128496/to-get-a-prompt-which-indicates-git-branch-in-zsh | |
# get the name of the branch we are on | |
git_prompt_info() { | |
git branch | awk '/^\*/ { print $2 }' | |
} | |
get_git_dirty() { | |
git diff --quiet || echo '*' | |
} | |
autoload -U colors | |
colors | |
setopt prompt_subst | |
PROMPT='%{$fg[blue]%}%c %{$fg_bold[red]%}$(git_prompt_info)$(get_git_dirty)%{$fg[blue]%} $ %{$reset_color%}' | |
RPROMPT='%{$fg[green]%}%1(j.%j.)' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment