Last active
June 15, 2018 09:56
-
-
Save Jeklah/7dd4ac3cd5ba60dd66b0fe0f405504bb to your computer and use it in GitHub Desktop.
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
# Original theme https://github.com/agnoster zsh theme | |
# modified by lborg019 | |
# further modified by Jeklah | |
ZSH_THEME_GIT_PROMPT_DIRTY=' ●' | |
function _git_prompt_info() { | |
ref=$(git symbolic-ref HEAD 2> /dev/null) || ref="➦ $(git show-ref --head -s --abbrev |head -n1 2> /dev/null)" | |
echo "${ref/refs\/heads\// }$(parse_git_dirty)" | |
} | |
function _git_info() { | |
if $(git rev-parse --is-inside-work-tree >/dev/null 2>&1); then | |
local BG_COLOR=green | |
if [[ -n $(parse_git_dirty) ]]; then | |
BG_COLOR=yellow | |
FG_COLOR=black | |
fi | |
if [[ ! -z $(git ls-files --other --exclude-standard 2> /dev/null) ]]; then | |
ZSH_THEME_GIT_PROMPT_DIRTY=" \u26A0" | |
BG_COLOR=red | |
FG_COLOR=white | |
fi | |
echo "%{%K{$BG_COLOR}%F{blue}%}%{%F{$FG_COLOR}%} $(_git_prompt_info) %{%F{$BG_COLOR}%k%}" | |
else | |
echo "%{%k%F{blue}%}" | |
fi | |
} | |
function virtualenv_info { | |
[ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') ' | |
} | |
PROMPT_HOST='%{%b%F{gray}%K{black}%} %(?.%{%F{green}%}✔.%{%F{red}%}✘)%{%F{yellow}%} %{%F{black}%}' | |
PROMPT_DIR='%{%F{white}%}%{%K{blue}%} %~% ' | |
PROMPT_SU='%(!.%{%k%F{blue}%K{black}%}%{%F{yellow}%} ⚡ %{%k%F{black}%}.%{%k%F{blue}%})%{%f%k%b%}' | |
PROMPT_ARROW='%{%K{blue}%}' | |
PROMPT='%{%f%b%k%}$PROMPT_HOST$PROMPT_ARROW$PROMPT_DIR$(_git_info)${reset_color%} ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment