Last active
April 12, 2018 11:26
-
-
Save Ricard/d8a31d01ac847b4a889fc7673a3f94fb to your computer and use it in GitHub Desktop.
My personalized 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
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