Created
May 11, 2020 20:29
-
-
Save drconopoima/dad4310d71ba8e9b32d8b2d28242d916 to your computer and use it in GitHub Desktop.
Minor modification to standard oh-my-zsh theme juanghurtado.zsh-theme to show git on the left and prompt colored according to return code
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
# Color shortcuts | |
RED=$fg[red] | |
YELLOW=$fg[yellow] | |
GREEN=$fg[green] | |
WHITE=$fg[white] | |
BLUE=$fg[blue] | |
RED_BOLD=$fg_bold[red] | |
YELLOW_BOLD=$fg_bold[yellow] | |
GREEN_BOLD=$fg_bold[green] | |
WHITE_BOLD=$fg_bold[white] | |
BLUE_BOLD=$fg_bold[blue] | |
RESET_COLOR=$reset_color | |
# Format for git_prompt_info() | |
ZSH_THEME_GIT_PROMPT_PREFIX="" | |
ZSH_THEME_GIT_PROMPT_SUFFIX="" | |
# Format for parse_git_dirty() | |
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$RED%}(*)" | |
ZSH_THEME_GIT_PROMPT_CLEAN="" | |
# Format for git_prompt_status() | |
ZSH_THEME_GIT_PROMPT_UNMERGED=" %{$RED%}unmerged" | |
ZSH_THEME_GIT_PROMPT_DELETED=" %{$RED%}deleted" | |
ZSH_THEME_GIT_PROMPT_RENAMED=" %{$YELLOW%}renamed" | |
ZSH_THEME_GIT_PROMPT_MODIFIED=" %{$YELLOW%}modified" | |
ZSH_THEME_GIT_PROMPT_ADDED=" %{$GREEN%}added" | |
ZSH_THEME_GIT_PROMPT_UNTRACKED=" %{$WHITE%}untracked" | |
# Format for git_prompt_ahead() | |
ZSH_THEME_GIT_PROMPT_AHEAD=" %{$RED%}(!)" | |
# Format for git_prompt_long_sha() and git_prompt_short_sha() | |
ZSH_THEME_GIT_PROMPT_SHA_BEFORE=" %{$WHITE%}[%{$YELLOW%}" | |
ZSH_THEME_GIT_PROMPT_SHA_AFTER="%{$WHITE%}]" | |
# Prompt format | |
PROMPT=' | |
%{$GREEN_BOLD%}%n@%m%{$WHITE%}:%{$YELLOW%}%~%u$(parse_git_dirty)$(git_prompt_ahead) %{$GREEN_BOLD%}$(git_current_branch)$(git_prompt_short_sha)$(git_prompt_status)%{$RESET_COLOR%} | |
%(?:%{$fg_bold[green]%}$:%{$fg_bold[red]%}$) %{$RESET_COLOR%}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment