-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHandy.zsh-theme
34 lines (28 loc) · 1.03 KB
/
Handy.zsh-theme
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Author: Hanley Lee
# Website: https://www.hanleylee.com
# GitHub: https://github.com/HanleyLee
# VCS
YS_VCS_PROMPT_PREFIX1=" %{$fg[white]%}on%{$reset_color%} "
YS_VCS_PROMPT_PREFIX2=":%{$fg[magenta]%}"
YS_VCS_PROMPT_SUFFIX="%{$reset_color%}"
YS_VCS_PROMPT_DIRTY=" %{$fg[red]%}x"
YS_VCS_PROMPT_CLEAN=" %{$fg[green]%}o"
# Git info
local git_info='$(git_prompt_info)'
ZSH_THEME_GIT_PROMPT_PREFIX="${YS_VCS_PROMPT_PREFIX1}git${YS_VCS_PROMPT_PREFIX2}"
ZSH_THEME_GIT_PROMPT_SUFFIX="$YS_VCS_PROMPT_SUFFIX"
ZSH_THEME_GIT_PROMPT_DIRTY="$YS_VCS_PROMPT_DIRTY"
ZSH_THEME_GIT_PROMPT_CLEAN="$YS_VCS_PROMPT_CLEAN"
# ternary expression %(?.<true expression>.<false expression>)
local exit_code='%(?.%F{green} ✔︎ 0.%F{red} ✘ %?)%f'
local prompt_symbol='%F{green}%(!.#.$)%f'
# Prompt on left of screen
PROMPT="\
%F{yellow}%n%f%F{grey}@%f%F{green}%m%f %F{blue}%B%~%b%f $git_info $exit_code
$prompt_symbol \
"
# Prompt on right of screen
RPROMPT='%*'
# For example:
# hanley@Hanleys-Mac-mini-home ~/.sh on git:main x ✘ 1 21:47:42
# $