-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.p10k.zsh7
executable file
·228 lines (185 loc) · 9.66 KB
/
.p10k.zsh7
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
#!/bin/zsh
# p10k.zsh:
# A custom theme based on POWERLEVEL10K.
# author: Everett
# created: 2020-11-04 14:35
# Github: https://github.com/antiqueeverett/
antigen theme romkatv/powerlevel10k
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
() {
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
# CONFIGURATION:
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
emulate -L zsh -o extended_glob
autoload -Uz is-at-least && is-at-least 5.1 || return
unset -m '(POWERLEVEL9K_*|DEFAULT_USER)~POWERLEVEL9K_GITSTATUS_DIR'
# font
typeset -g POWERLEVEL9K_MODE=nerdfont-complete
typeset -g POWERLEVEL9K_ICON_PADDING=moderate
# set icons before content on both sides
typeset -g POWERLEVEL9K_ICON_BEFORE_CONTENT=true
# new empty line before prompt
typeset -g POWERLEVEL9K_PROMPT_ADD_NEWLINE=false
# connect left and right prompt using
typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX=
typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_PREFIX=
typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_SUFFIX=
typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_SUFFIX=
typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_SUFFIX=
# end left and right prompt segments using
typeset -g POWERLEVEL9K_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL=
typeset -g POWERLEVEL9K_RIGHT_PROMPT_LAST_SEGMENT_END_SYMBOL=
# directory hyperlink
typeset -g POWERLEVEL9K_DIR_HYPERLINK=false
# ????
typeset -g POWERLEVEL9K_SHOW_CHANGESET=true
typeset -g POWERLEVEL9K_CHANGESET_HASH_LENGTH=6
# transient prompt
typeset -g POWERLEVEL9K_TRANSIENT_PROMPT=always
typeset -g POWERLEVEL9K_INSTANT_PROMPT=verbose
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
# LEFT PROMPT SEGMENTS:
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir vcs)
# general aesthetic
typeset -g POWERLEVEL9K_{LEFT,RIGHT}_SUBSEGMENT_SEPARATOR=' ' # separate segments with a space
# typeset -g POWERLEVEL9K_BACKGROUND= # transparent background
# typeset -g POWERLEVEL9K_{LEFT,RIGHT}_{LEFT,RIGHT}_WHITESPACE= # no surrounding whitespace
# typeset -g POWERLEVEL9K_{LEFT,RIGHT}_SEGMENT_SEPARATOR= # no end-of-line symbol
# prompt prefix
typeset -g POWERLEVEL9K_PROMPT_ON_NEWLINE=true
typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX="%F{243}\uf120 "
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIINS_CONTENT_EXPANSION=''
typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=243 # pass
typeset -g POWERLEVEL9K_PROMPT_CHAR_ERROR_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=124 # fail
# Prompt symbol in command vi mode.
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION='❮'
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='V'
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIOWR_CONTENT_EXPANSION='▶'
typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=true
# No line terminator if prompt_char is the last segment.
typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL=''
# No line introducer if prompt_char is the first segment.
typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL=
# shorten directory
typeset -g POWERLEVEL9K_SHORTEN_DIR_LENGTH=2
# /etc/
typeset -g POWERLEVEL9K_ETC_ICON=
typeset -g POWERLEVEL9K_DIR_ETC_FOREROUND='130'
typeset -g POWERLEVEL9K_DIR_ETC_BACKGROUND='clear'
# root -
typeset -g POWERLEVEL9K_FOLDER_ICON=''
typeset -g POWERLEVEL9K_DIR_DEFAULT_FOREGROUND='130'
typeset -g POWERLEVEL9K_DIR_DEFAULT_BACKGROUND='clear'
# home|user 狀
typeset -g POWERLEVEL9K_HOME_ICON="%F{130}\uf02c "
typeset -g POWERLEVEL9K_HOME_ICON_BACKGROUND='clear'
# user|folder
typeset -g POWERLEVEL9K_HOME_SUB_ICON=' '
typeset -g POWERLEVEL9K_DIR_HOME_BACKGROUND='clear'
# leading tilde -
typeset -g POWERLEVEL9K_HOME_FOLDER_ABBREVIATION=''
# directory path delimiter
typeset -g POWERLEVEL9K_DIR_PATH_SEPARATOR=' '
typeset -g POWERLEVEL9K_SHORTEN_DELIMITER="%F{239} \uf0c50 "
# home, user, tilder, delimiter color
typeset -g POWERLEVEL9K_DIR_HOME_SUBFOLDER_FOREGROUND='000'
typeset -g POWERLEVEL9K_DIR_HOME_SUBFOLDER_BACKGROUND='130'
# forbidden directory lock icon
typeset -g POWERLEVEL9K_DIR_WRITABLE_FORBIDDEN_FOREGROUND='000'
typeset -g POWERLEVEL9K_DIR_WRITABLE_FORBIDDEN_BACKGROUND='130'
# directory path and subversion segment delimiter ????
typeset -g POWERLEVEL9K_LEFT_SUBSEGMENT_SEPARATOR=' -- '
# nvm
typeset -g POWERLEVEL9K_NVM_FOREGROUND='239'
typeset -g POWERLEVEL9K_NVM_BACKGROUND='clear'
typeset -g POWERLEVEL9K_VCS_GIT_HOOKS=(vcs-detect-changes git-untracked git-aheadbehind git-remotebranch git-tagname)
# VCS:
typeset -g POWERLEVEL9K_VCS_GIT_ICON=' '
typeset -g POWERLEVEL9K_VCS_GIT_GITHUB_ICON=' '
typeset -g POWERLEVEL9K_VCS_BRANCH_ICON=' '
typeset -g POWERLEVEL9K_VCS_UNTRACKED_ICON=ﰗ
typeset -g POWERLEVEL9K_VCS_UNSTAGED_ICON=ﰖ
typeset -g POWERLEVEL9K_VCS_INCOMING_CHANGES_ICON=⇣
typeset -g POWERLEVEL9K_VCS_OUTGOING_CHANGES_ICON=⇡
typeset -g POWERLEVEL9K_VCS_CLEAN_FOREGROUND='034'
typeset -g POWERLEVEL9K_VCS_MODIFIED_FOREGROUND='124'
typeset -g POWERLEVEL9K_VCS_UNTRACKED_FOREGROUND='124'
typeset -g POWERLEVEL9K_VCS_CLEAN_BACKGROUND='clear'
typeset -g POWERLEVEL9K_VCS_MODIFIED_BACKGROUND='clear'
typeset -g POWERLEVEL9K_VCS_UNTRACKED_BACKGROUND='clear'
typeset -g POWERLEVEL9K_VCS_{STAGED,UNSTAGED,UNTRACKED,CONFLICTED,COMMITS_AHEAD,COMMITS_BEHIND}_MAX_NUM=-1
typeset -g POWERLEVEL9K_VCS_BACKENDS=(git)
# typeset -g POWERLEVEL9K_VCS_VISUAL_IDENTIFIER_COLOR=76
# typeset -g POWERLEVEL9K_VCS_LOADING_VISUAL_IDENTIFIER_COLOR=244
# typeset -g POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY=-1
# <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
# RIGHT PROMPT SEGMENTS:
# <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status command_execution_time nvm dir_writable time load public_ip)
# exit status
# typeset -g POWERLEVEL9K_STATUS_EXTENDED_STATES=true
# typeset -g POWERLEVEL9K_STATUS_VERBOSE=false
typeset -g POWERLEVEL9K_STATUS_OK=true
typeset -g POWERLEVEL9K_STATUS_OK_VISUAL_IDENTIFIER_EXPANSION="%F{246} "
typeset -g POWERLEVEL9K_STATUS_OK_PIPE=true
typeset -g POWERLEVEL9K_STATUS_OK_PIPE_FOREGROUND='246'
typeset -g POWERLEVEL9K_STATUS_OK_PIPE_VISUAL_IDENTIFIER_EXPANSION="%F{246} "
typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE=true
typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_FOREGROUND=160
typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_VISUAL_IDENTIFIER_EXPANSION=
typeset -g POWERLEVEL9K_STATUS_ERROR=true
typeset -g POWERLEVEL9K_STATUS_ERROR_VISUAL_IDENTIFIER_EXPANSION=
typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL=true
typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_FOREGROUND=160
typeset -g POWERLEVEL9K_STATUS_VERBOSE_SIGNAME=false
typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_VISUAL_IDENTIFIER_EXPANSION=
typeset -g POWERLEVEL9K_STATUS_ERROR_BACKGROUND='clear'
typeset -g POWERLEVEL9K_STATUS_OK_BACKGROUND='clear'
typeset -g POWERLEVEL9K_STATUS_BACKGROUND='clear'
# segment separator
typeset -g POWERLEVEL9K_RIGHT_SUBSEGMENT_SEPARATOR="%F{246}|"
# # execution time
typeset -g POWERLEVEL9K_EXECUTION_TIME_ICON='神'
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FORMAT='d h m s'
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=3
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND='246'
typeset -g POWERLEVEL9K_COMMAND_BACKGROUND_JOBS_FOREGROUND='246'
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_BACKGROUND='clear'
typeset -g POWERLEVEL9K_COMMAND_BACKGROUND_JOBS_BACKGROUND='clear'
#typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_VISUAL_IDENTIFIER_EXPANSION=
# time
typeset -g POWERLEVEL9K_TIME_FOREGROUND='246'
typeset -g POWERLEVEL9K_TIME_BACKGROUND='clear'
typeset -g POWERLEVEL9K_TIME_UPDATE_ON_COMMAND=true
typeset -g POWERLEVEL9K_TIME_VISUAL_IDENTIFIER_EXPANSION=
typeset -g POWERLEVEL9K_TIME_FORMAT="%D{%H:%M \uf455 %d.%m.%y}"
# load
typeset -g POWERLEVEL9K_LOAD_NORMAL_VISUAL_IDENTIFIER_COLOR='246'
typeset -g POWERLEVEL9K_LOAD_WARNING_VISUAL_IDENTIFIER_COLOR='124'
typeset -g POWERLEVEL9K_LOAD_CRITICAL_VISUAL_IDENTIFIER_COLOR='124'
typeset -g POWERLEVEL9K_LOAD_NORMAL_BACKGROUND='clear'
typeset -g POWERLEVEL9K_LOAD_WARNING_BACKGROUND='clear'
typeset -g POWERLEVEL9K_LOAD_CRITICAL_BACKGROUND='clear'
# public
typeset -g POWERLEVEL9K_PUBLIC_IP_FOREGROUND='246'
typeset -g POWERLEVEL9K_PUBLIC_IP_BACKGROUND='clear'
typeset -g POWERLEVEL9K_PUBLIC_IP_VISUAL_IDENTIFIER_EXPANSION=' '
# # Todo color.
# typeset -g POWERLEVEL9K_TODO_FOREGROUND=110
# typeset -g POWERLEVEL9K_TODO_HIDE_ZERO_TOTAL=true
# typeset -g POWERLEVEL9K_TODO_HIDE_ZERO_FILTERED=false
# # privilege context
# typeset -g POWERLEVEL9K_CONTEXT_ROOT_FOREGROUND=178
# typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_FOREGROUND=180
# typeset -g POWERLEVEL9K_CONTEXT_FOREGROUND=180
# typeset -g POWERLEVEL9K_CONTEXT_ROOT_TEMPLATE='%B%n@%m'
# typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_TEMPLATE='%n@%m'
# typeset -g POWERLEVEL9K_CONTEXT_TEMPLATE='%n@%m'
# # always show context (remove to set true)
# typeset -g POWERLEVEL9K_CONTEXT_{DEFAULT,SUDO}_{CONTENT,VISUAL_IDENTIFIER}_EXPANSION=
}
# color map oneliner: for i in {0..255}; do print -Pn "%K{$i} %k%F{$i}${(l:3::0:)i}%f " ${${(M)$((i%6)):#3}:+$'\n'}; done