Created
January 22, 2014 07:20
-
-
Save rockkhuya/8554724 to your computer and use it in GitHub Desktop.
OH-MY-ZSH git-flow theme
This file contains 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
# Created by Luu Tuan Anh, OKWave Inc. | |
function git_prompt_info_short() { | |
if [[ "$(git config --get oh-my-zsh.hide-status)" != "1" ]]; then | |
ref=$(command git symbolic-ref HEAD 2> /dev/null) || \ | |
ref=$(command git rev-parse --short HEAD 2> /dev/null) || return | |
ref="${ref#refs/heads/}" | |
if echo "$ref" | egrep "feature" > /dev/null; then | |
ref="f/${ref#feature/}" | |
fi | |
if echo "$ref" | egrep "release" > /dev/null; then | |
ref="r/${ref#release/}" | |
fi | |
if echo "$ref" | egrep "hotfix" > /dev/null; then | |
ref="h/${ref#hotfix/}" | |
fi | |
if echo "$ref" | egrep "support" > /dev/null; then | |
ref="s/${ref#support/}" | |
fi | |
echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX" | |
fi | |
} | |
ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}" | |
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " | |
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%}⚡%{$reset_color%}" | |
ZSH_THEME_GIT_PROMPT_CLEAN="" | |
PROMPT='%{$fg[cyan]%}%1~%{$reset_color%}%{$fg[red]%}|%{$reset_color%}$(git_prompt_info_short)%{$fg[cyan]%}%{$reset_color%}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment