Last active
December 8, 2020 20:41
-
-
Save nimajneBG/f14b36ff32c4159b1343f91833b25ad1 to your computer and use it in GitHub Desktop.
Simple ZSH-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
# Simple ZSH-Theme | |
# | |
# A simple theme for zsh with oh-my-zsh installed. Displays git repo status if the last ran programm | |
# finished with exit-code 0 and a indicator for being the root user | |
# | |
# (c) by Benjamin Grau | |
# Functions | |
username() { | |
echo '%F{green}%n%f' | |
} | |
dir() { | |
echo '%F{cyan}%1~%f' | |
} | |
prompt_indicator() { | |
if [ $USER = 'root' ]; then | |
echo '%(?.#.%F{red}#%f)' | |
else | |
echo '%(?.$.%F{red}$%f)' | |
fi | |
} | |
# Gitinfo parameter | |
ZSH_THEME_GIT_PROMPT_PREFIX=" %F{blue}" | |
ZSH_THEME_GIT_PROMPT_SUFFIX="%f" | |
ZSH_THEME_GIT_PROMPT_DIRTY="%F{magenta}*%f" | |
ZSH_THEME_GIT_PROMPT_CLEAN="%F{green}*%f" | |
ZSH_THEME_GIT_PROMPT_ADDED=" %F{green}+%f" | |
ZSH_THEME_GIT_PROMPT_MODIFIED=" %F{yellow}!%f" | |
ZSH_THEME_GIT_PROMPT_DELETED=" %F{red}-%f" | |
ZSH_THEME_GIT_PROMPT_RENAMED=" %F{magenta}>%f" | |
ZSH_THEME_GIT_PROMPT_UNMERGED=" %F{blue}#%f" | |
ZSH_THEME_GIT_PROMPT_UNTRACKED=" %F{cyan}?%f" | |
# Actual promt | |
PROMPT='%B[ $(username):$(dir)$(git_prompt_info)$(git_prompt_status) ] $(prompt_indicator) %b' | |
RPROMPT='' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment