Skip to content

Instantly share code, notes, and snippets.

@Cosaquee
Created January 15, 2018 11:02
Show Gist options
  • Save Cosaquee/ba8893915889144f4a8332537527a9fc to your computer and use it in GitHub Desktop.
Save Cosaquee/ba8893915889144f4a8332537527a9fc to your computer and use it in GitHub Desktop.
# Depends on the git plugin for work_in_progress()
ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%} "
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN=""
git_custom_status() {
local cb=$(git_current_branch)
if [ -n "$cb" ]; then
echo "$ZSH_THEME_GIT_PROMPT_PREFIX$(git_current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX$(parse_git_dirty)%{$fg_bold[yellow]%}$(work_in_progress)%{$reset_color%}"
fi
}
PROMPT='%{$fg[green]%}%n@%m %{$fg[blue]%}%1~$(git_custom_status)%(?.%{$fg[green]%}.%{$fg[red]%})%{$reset_color%} '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment