Skip to content
This repository has been archived by the owner on Mar 31, 2022. It is now read-only.

Commit

Permalink
🎨 add vars
Browse files Browse the repository at this point in the history
  • Loading branch information
blyndusk committed May 15, 2019
1 parent 7ddcb96 commit daa9e45
Showing 1 changed file with 36 additions and 27 deletions.
63 changes: 36 additions & 27 deletions sm.zsh-theme
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,41 @@
# 2 : username & machine hostname + git prompt
# 3 : username & machine hostname + current working directory + git prompt

local return_code="%(?..%F{red}%? - )%F{default}"

local issudo="blue";

if [ "$UID" -eq 0 ] ; then issudo="red" ; fi

local prompt_template=(
'%F{yellow}β”Œβ”€%F{${issudo}}%n%F{yellow}@%F{cyan}%M $(git_prompt_info) $(git_prompt_status)%F{default}
'
'%F{yellow}β”œβ”€ %F{magenta}%~%F{default}
'
'%F{yellow}└──→%F{default} '
local RETURN_CODE="%(?..%F{red}%? - )%F{default}";
local ROOT_COLOR="blue";

if [ "$UID" -eq 0 ] ; then ROOT_COLOR="red" ; fi ;

local SM_PREFIX="%F{yellow}╭─";
local SM_MIDFIX="%F{yellow}β”œβ”€";
local SM_SUFFIX="%F{yellow}╰──→%F{default} ";

local SM_USER="%F{${ROOT_COLOR}}%n%F{yellow}@%F{cyan}%m";
local SM_GIT="$(git_prompt_info) $(git_prompt_status)%F{default}";
local SM_DIR="%F{magenta}%~%F{default}";
local SM_CLOCK="${RETURN_CODE}%F{cyan}%D%F{yellow} / %F{blue}%T%F{default}";
local SM_FINAL_PROMPT="";

local SM_PROMPT_TEMPLATE=(
"$SM_PREFIX $SM_USER $SM_GIT
"
"$SM_MIDFIX $SM_DIR
"
"$SM_SUFFIX"
)

for i in "${prompt_template[@]}" ; do final_prompt+="$i" ; done

PROMPT="$final_prompt"
RPROMPT='${return_code}%F{magenta}%D%F{yellow} /%F{magenta}%t%F{default}'
ZSH_THEME_GIT_PROMPT_PREFIX="%F{magenta}git:%F{default}"
ZSH_THEME_GIT_PROMPT_SUFFIX=""
ZSH_THEME_GIT_PROMPT_DIRTY=" %F{red}✘%F{default}"
ZSH_THEME_GIT_PROMPT_CLEAN=" %F{green}βœ”οΈŽ%F{default}"

ZSH_THEME_GIT_PROMPT_ADDED="%F{green}●%F{default} "
ZSH_THEME_GIT_PROMPT_MODIFIED="%F{yellow}β—Ž%F{default} "
ZSH_THEME_GIT_PROMPT_DELETED="%F{red}β—‹%F{default} "
ZSH_THEME_GIT_PROMPT_RENAMED="%F{blue}β€£%F{default} "
ZSH_THEME_GIT_PROMPT_UNMERGED="%F{magenta}βœ–%F{default} "
ZSH_THEME_GIT_PROMPT_UNTRACKED="%F{magenta}✦%F{default} "
for i in "${SM_PROMPT_TEMPLATE[@]}" ; do SM_FINAL_PROMPT+="$i" ; done ;

PROMPT="$SM_FINAL_PROMPT";
RPROMPT="$SM_CLOCK";
ZSH_THEME_GIT_PROMPT_PREFIX="%F{magenta}git:%F{default}";
ZSH_THEME_GIT_PROMPT_SUFFIX="";
ZSH_THEME_GIT_PROMPT_DIRTY=" %F{red}✘%F{default}";
ZSH_THEME_GIT_PROMPT_CLEAN=" %F{green}βœ”οΈŽ%F{default}";

ZSH_THEME_GIT_PROMPT_ADDED="%F{green}●%F{default} ";
ZSH_THEME_GIT_PROMPT_MODIFIED="%F{yellow}β—Ž%F{default} ";
ZSH_THEME_GIT_PROMPT_DELETED="%F{red}β—‹%F{default} ";
ZSH_THEME_GIT_PROMPT_RENAMED="%F{blue}β€£%F{default} ";
ZSH_THEME_GIT_PROMPT_UNMERGED="%F{magenta}βœ–%F{default} ";
ZSH_THEME_GIT_PROMPT_UNTRACKED="%F{magenta}✦%F{default} ";

0 comments on commit daa9e45

Please sign in to comment.