Skip to content

Instantly share code, notes, and snippets.

@Ricard
Last active April 12, 2018 11:26
Show Gist options
  • Save Ricard/d8a31d01ac847b4a889fc7673a3f94fb to your computer and use it in GitHub Desktop.
Save Ricard/d8a31d01ac847b4a889fc7673a3f94fb to your computer and use it in GitHub Desktop.
My personalized zsh theme
setopt prompt_subst
() {
# Check the UID
local PR_PROMPT
if [[ $UID -ne 0 ]]; then # normal user
PR_PROMPT='%{$fg[green]%}➤ '
else # root
PR_PROMPT='%F{red}➤ %f'
fi
local return_code="%(?..%F{red}%? ↵%f)"
local current_dir="%B%F{green}%~%f%b"
local git_branch='$(git_prompt_info)'
PROMPT="
%{$fg[green]%}╭─ ${current_dir} ${git_branch}
%{$fg[green]%}╰─$PR_PROMPT "
RPROMPT="${return_code} %{$fg_bold[grey]%} %T% %{$reset_color%}" #⏳
ZSH_THEME_GIT_PROMPT_PREFIX="%F{cyan}"
ZSH_THEME_GIT_PROMPT_SUFFIX=" %f"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment