-
Notifications
You must be signed in to change notification settings - Fork 0
/
solarized-powerline.zsh-theme
102 lines (87 loc) · 2.44 KB
/
solarized-powerline.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# You can set following options in your .zshrc
# OS detection
[[ -n "${OS}" ]] || OS=$(uname)
# background color
BG_COLOR_BASE03=%K{8}
BG_COLOR_BASE02=%K{0}
BG_COLOR_BASE01=%K{10}
BG_COLOR_BASE00=%K{11}
BG_COLOR_BASE0=%K{12}
BG_COLOR_BASE1=%K{14}
BG_COLOR_BASE2=%K{7}
BG_COLOR_BASE3=%K{15}
BG_COLOR_YELLOW=%K{3}
BG_COLOR_ORANGE=%K{1}
BG_COLOR_RED=%K{9}
BG_COLOR_MAGENTA=%K{5}
BG_COLOR_VIOLET=%K{13}
BG_COLOR_BLUE=%K{4}
BG_COLOR_CYAN=%K{6}
BG_COLOR_GREEN=%K{2}
# foreground color
FG_COLOR_BASE03=%F{8}
FG_COLOR_BASE02=%F{0}
FG_COLOR_BASE01=%F{10}
FG_COLOR_BASE00=%F{11}
FG_COLOR_BASE0=%F{12}
FG_COLOR_BASE1=%F{14}
FG_COLOR_BASE2=%F{7}
FG_COLOR_BASE3=%F{15}
FG_COLOR_YELLOW=%F{3}
FG_COLOR_ORANGE=%F{1}
FG_COLOR_RED=%F{9}
FG_COLOR_MAGENTA=%F{5}
FG_COLOR_VIOLET=%F{13}
FG_COLOR_BLUE=%F{4}
FG_COLOR_CYAN=%F{6}
FG_COLOR_GREEN=%F{2}
# reset color
local RESET_COLOR=%f%k%b
local RESET=%{$RESET_COLOR%}
local RETURN_CODE="%(?..$FG_COLOR_RED%? ↵$RESET)"
local ARROW_SYMBOL='|'
local ZSH_TIME=%D{%m/%d\ %H:%M}
local PADDING=''
GIT_DIRTY_COLOR=%F{196}
GIT_CLEAN_COLOR=%F{118}
GIT_PROMPT_INFO=%F{012}
ZSH_THEME_GIT_PROMPT_PREFIX=" "
ZSH_THEME_GIT_PROMPT_SUFFIX="$GIT_PROMPT_INFO"
ZSH_THEME_GIT_PROMPT_DIRTY=" $GIT_DIRTY_COLOR✘"
ZSH_THEME_GIT_PROMPT_CLEAN=" $GIT_CLEAN_COLOR✔"
ZSH_THEME_GIT_PROMPT_ADDED="%F{082}✚%f"
ZSH_THEME_GIT_PROMPT_MODIFIED="%F{166}✹%f"
ZSH_THEME_GIT_PROMPT_DELETED="%F{160}✖%f"
ZSH_THEME_GIT_PROMPT_RENAMED="%F{220]➜%f"
ZSH_THEME_GIT_PROMPT_UNMERGED="%F{082]═%f"
ZSH_THEME_GIT_PROMPT_UNTRACKED="%F{190]✭%f"
# a new line before prompt
PROMPT="
"
PADDING=' '
# hostname if ssh
[[ -v SSH_CLIENT ]] && {
HOSTNAME=$(hostname -s)
PROMPT="${PROMPT}${FG_COLOR_BASE01}${BG_COLOR_BASE0}${PADDING}${HOSTNAME}"
PROMPT="${PROMPT} ${FG_COLOR_BASE01}${BG_COLOR_BASE0}${ARROW_SYMBOL}"
}
# datetime
PROMPT="${PROMPT}${FG_COLOR_BASE01}${BG_COLOR_BASE01}${PADDING}${ZSH_TIME}"
PROMPT="${PROMPT} ${FG_COLOR_BASE01}${BG_COLOR_BASE01}${ARROW_SYMBOL}"
# current directory (%E hightline all line to end)
DIRECOTORY_DEPTH="%4~"
PROMPT="${PROMPT}${FG_COLOR_BASE3}${BG_COLOR_BASE02} ${DIRECOTORY_DEPTH}"
# show git status
PROMPT="${PROMPT}"'$(git_prompt_info)'
# show kube context
KUBE_PS1_SYMBOL_DEFAULT=""
KUBE_PS1_PREFIX=""
KUBE_PS1_SUFFIX=""
KUBE_PS1_SEPARATOR=""
KUBE_PS1_CTX_COLOR=9
KUBE_PS1_NS_COLOR=4
PROMPT="${PROMPT} ${ARROW_SYMBOL} "'$(kube_ps1)'
# end prompt
PROMPT="${PROMPT} ${RESET}${FG_COLOR_BASE02}${ARROW_SYMBOL}"
# reset
PROMPT="$PROMPT ${RESET}"