Created
March 30, 2018 17:07
-
-
Save steven89/f90be6c105eb4600a0e2df275bd827f0 to your computer and use it in GitHub Desktop.
Oh my Zsh theme
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
# ZSH Theme emulating the Fish shell's default prompt. | |
_fishy_collapsed_wd() { | |
echo $(pwd | perl -pe " | |
BEGIN { | |
binmode STDIN, ':encoding(UTF-8)'; | |
binmode STDOUT, ':encoding(UTF-8)'; | |
}; s|^$HOME|~|g; s|/([^/])[^/]*(?=/)|/\$1|g | |
") | |
} | |
if [ $UID -eq 0 ]; then | |
NCOLOR="red"; | |
elif [ "$USER" = "steven" ]; then | |
NCOLOR="yellow"; | |
else | |
NCOLOR="green"; | |
fi | |
ATCOLOR="green" | |
HOSTCOLOR="cyan" | |
GITCOLOR="yellow" | |
local return_status="%{$fg_bold[red]%}%(?..%?)%{$reset_color%}" | |
PROMPT='%{$fg[$NCOLOR]%}%n%{$fg[$ATCOLOR]%}@%{$fg[$HOSTCOLOR]%}%m%{$reset_color%} \ | |
%{$fg[$user_color]%}$(_fishy_collapsed_wd)%{$reset_color%} \ | |
%{$fg_bold[red]%}${return_status}%{$reset_color%}\ | |
%{$fg[$GITCOLOR]%}$(git_prompt_info)%{$reset_color%}$(git_prompt_status)%{$reset_color%} \ | |
%(!.#.>) ' | |
PROMPT2='%{$fg[red]%}\ %{$reset_color%}' | |
ZSH_THEME_GIT_PROMPT_PREFIX=" " | |
ZSH_THEME_GIT_PROMPT_SUFFIX="" | |
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}✗ " | |
ZSH_THEME_GIT_PROMPT_CLEAN=" %{$fg[green]%}✓" | |
ZSH_THEME_GIT_PROMPT_ADDED="%{$fg_bold[green]%}+" | |
ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg_bold[blue]%}!" | |
ZSH_THEME_GIT_PROMPT_DELETED="%{$fg_bold[red]%}-" | |
ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg_bold[magenta]%}>" | |
ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg_bold[yellow]%}#" | |
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg_bold[cyan]%}?" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment