Skip to content

Instantly share code, notes, and snippets.

@hharnisc
Created March 7, 2017 15:12
Show Gist options
  • Save hharnisc/6fae2b2642f90fc009822b7a83aa127c to your computer and use it in GitHub Desktop.
Save hharnisc/6fae2b2642f90fc009822b7a83aa127c to your computer and use it in GitHub Desktop.
ZSH Theme
#!/usr/bin/env zsh
#local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
setopt promptsubst
autoload -U add-zsh-hook
ROOT_ICON_COLOR=$fg[red]
MACHINE_NAME_COLOR=$fg[white]
CURRENT_DIRECTORY_COLOR=$fg[blue]
GIT_PROMPT_INFO=$fg[white]
PROMPT_PROMPT=$fg[white]
GIT_DIRTY_COLOR=$fg[red]
GIT_CLEAN_COLOR=$fg[green]
GIT_CHANGE_COLOR=$fg[yellow]
# Hash
ROOT_ICON="# "
if [[ $EUID -ne 0 ]] ; then
ROOT_ICON=""
fi
PROMPT='%{$ROOT_ICON_COLOR%}$ROOT_ICON%{$reset_color%}%{$MACHINE_NAME_COLOR%}%m➜ %{$reset_color%}%{$CURRENT_DIRECTORY_COLOR%}%c%{$reset_color%} %{$GIT_PROMPT_INFO%}$(git_prompt_info)%{$GIT_DIRTY_COLOR%}$(git_prompt_status) %{$reset_color%}%{$PROMPT_PROMPT%}ᐅ %{$reset_color%} '
#RPS1="${return_code}"
ZSH_THEME_GIT_PROMPT_PREFIX=": "
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$GIT_PROMPT_INFO%} :"
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$GIT_DIRTY_COLOR%}✘"
ZSH_THEME_GIT_PROMPT_CLEAN=" %{$GIT_CLEAN_COLOR%}✔"
ZSH_THEME_GIT_PROMPT_ADDED="%{$GIT_CHANGE_COLOR%}✚%{$rset_color%}"
ZSH_THEME_GIT_PROMPT_MODIFIED="%{$GIT_CHANGE_COLOR%}✹%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DELETED="%{$GIT_CHANGE_COLOR%}✖%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_RENAMED="%{$GIT_CHANGE_COLOR%}➜%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_UNMERGED="%{$GIT_CHANGE_COLOR%}═%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$GIT_CHANGE_COLOR%}✭%{$reset_color%}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment