-
Notifications
You must be signed in to change notification settings - Fork 0
/
.p10k.zsh
151 lines (122 loc) · 6.45 KB
/
.p10k.zsh
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
# Generated by Powerlevel10k configuration wizard on 2023-11-28 at 15:06 GMT.
# info / docs around here https://github.com/romkatv/powerlevel10k/blob/master/config/p10k-classic.zsh
# Temporarily change options.
'builtin' 'local' '-a' 'p10k_config_opts'
[[ ! -o 'aliases' ]] || p10k_config_opts+=('aliases')
[[ ! -o 'sh_glob' ]] || p10k_config_opts+=('sh_glob')
[[ ! -o 'no_brace_expand' ]] || p10k_config_opts+=('no_brace_expand')
'builtin' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand'
function prompt_zig_version() {
[[ -n $(find . -maxdepth 1 -name "*.zig" 2>/dev/null) ]] || return
p10k segment -f 39 -t zig_version
}
() {
emulate -L zsh -o extended_glob
# Unset all configuration options.
unset -m '(POWERLEVEL9K_*|DEFAULT_USER)~POWERLEVEL9K_GITSTATUS_DIR'
# Zsh >= 5.1 is required.
[[ $ZSH_VERSION == (5.<1->*|<6->.*) ]] || return
local grey='242'
local red='#d27e9a'
local yellow='#e6c384'
local blue='#7e9cd8'
local magenta='#947fb8'
local cyan='#66ffdd'
local green='#5faf94'
local white='#dcd7ba'
# Left prompt segments.
typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(
# =========================[ Line #1 ]=========================
context # user@host
dir # current directory
vcs # git status
status
command_execution_time # previous command duration
# =========================[ Line #2 ]=========================
newline # \n
prompt_char # prompt symbol
)
# Right prompt segments.
typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(
# =========================[ Line #1 ]=========================
time # current time
pyenv
virtualenv
node_version
nix_shell # https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html
rust_version
zig_version
# =========================[ Line #2 ]=========================
newline # \n
)
typeset -g POWERLEVEL9K_BACKGROUND= # transparent background
typeset -g POWERLEVEL9K_{LEFT,RIGHT}_{LEFT,RIGHT}_WHITESPACE= # no surrounding whitespace
typeset -g POWERLEVEL9K_{LEFT,RIGHT}_SUBSEGMENT_SEPARATOR=' ' # separate segments with a space
typeset -g POWERLEVEL9K_{LEFT,RIGHT}_SEGMENT_SEPARATOR= # no end-of-line symbol
typeset -g POWERLEVEL9K_VISUAL_IDENTIFIER_EXPANSION= # no segment icons
typeset -g POWERLEVEL9K_STATUS_ERROR=true
typeset -g POWERLEVEL9K_STATUS_ERROR_VISUAL_IDENTIFIER_EXPANSION='✘'
typeset -g POWERLEVEL9K_STATUS_ERROR_FOREGROUND=$red
typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL=true
typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_VISUAL_IDENTIFIER_EXPANSION='✘'
typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_FOREGROUND=$red
typeset -g POWERLEVEL9K_PROMPT_ADD_NEWLINE=true
typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_{VIINS,VICMD,VIVIS}_FOREGROUND=$magenta
typeset -g POWERLEVEL9K_PROMPT_CHAR_ERROR_{VIINS,VICMD,VIVIS}_FOREGROUND=$red
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIINS_CONTENT_EXPANSION='→'
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION='|'
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='|'
typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=false
typeset -g POWERLEVEL9K_PYENV_FOREGROUND=$green
typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=$blue
typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=true
typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER=
typeset -g POWERLEVEL9K_VIRTUALENV_CONTENT_EXPANSION=' $(python --version | sed "s/Python //")'
typeset -g POWERLEVEL9K_RUST_VERSION_FOREGROUND=$red
typeset -g POWERLEVEL9K_RUST_VERSION_PROJECT_ONLY=true
typeset -g POWERLEVEL9K_RUST_VERSION_CONTENT_EXPANSION=" $(rustc --version | awk -F' ' '{print $2}')"
# Customize the node_version content to include an icon
typeset -g POWERLEVEL9K_NODE_VERSION_CONTENT_EXPANSION=' $(node --version | sed "s/v//")'
typeset -g POWERLEVEL9K_NODE_VERSION_PROJECT_ONLY=true
typeset -g POWERLEVEL9K_NODE_VERSION_FOREGROUND=$green
typeset -g POWERLEVEL9K_NODE_VERSION_BACKGROUND=none
#[ nix_shell: nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) ]##
typeset -g POWERLEVEL9K_NIX_SHELL_FOREGROUND=$magenta
typeset -g POWERLEVEL9K_NIX_SHELL_VISUAL_IDENTIFIER_EXPANSION=''
typeset -g POWERLEVEL9K_DIR_FOREGROUND=$blue
typeset -g POWERLEVEL9K_CONTEXT_ROOT_TEMPLATE="%F{$magenta}%n%f%F{$magenta}@%m%f"
typeset -g POWERLEVEL9K_CONTEXT_TEMPLATE="%F{$magenta}%n@%m%f"
typeset -g POWERLEVEL9K_CONTEXT_{DEFAULT,SUDO}_CONTENT_EXPANSION=
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=2
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_FOREGROUND=$yellow
typeset -g POWERLEVEL9K_VCS_FOREGROUND=$grey
typeset -g POWERLEVEL9K_VCS_LOADING_TEXT=
typeset -g POWERLEVEL9K_VCS_MAX_SYNC_LATENCY_SECONDS=0
typeset -g POWERLEVEL9K_VCS_{INCOMING,OUTGOING}_CHANGESFORMAT_FOREGROUND=$cyan
typeset -g POWERLEVEL9K_VCS_GIT_HOOKS=(vcs-detect-changes git-untracked git-aheadbehind)
typeset -g POWERLEVEL9K_VCS_BRANCH_ICON=':'
typeset -g POWERLEVEL9K_VCS_COMMIT_ICON=':'
typeset -g POWERLEVEL9K_VCS_{STAGED,UNSTAGED,UNTRACKED}_ICON=
typeset -g POWERLEVEL9K_VCS_DIRTY_ICON=':'
typeset -g POWERLEVEL9K_VCS_INCOMING_CHANGES_ICON=':⇣'
typeset -g POWERLEVEL9K_VCS_OUTGOING_CHANGES_ICON=':⇡'
typeset -g POWERLEVEL9K_VCS_{COMMITS_AHEAD,COMMITS_BEHIND}_MAX_NUM=1
typeset -g POWERLEVEL9K_VCS_CONTENT_EXPANSION='${${${P9K_CONTENT/⇣* :⇡/⇣⇡}// }//:/ }'
typeset -g POWERLEVEL9K_TIME_FOREGROUND=$grey
typeset -g POWERLEVEL9K_TIME_FORMAT='%D{%H:%M:%S}'
typeset -g POWERLEVEL9K_TIME_UPDATE_ON_COMMAND=true
typeset -g POWERLEVEL9K_TRANSIENT_PROMPT=off
typeset -g POWERLEVEL9K_INSTANT_PROMPT=quiet
typeset -g POWERLEVEL9K_DISABLE_HOT_RELOAD=true
typeset -g POWERLEVEL9K_ZIG_VERSION_FOREGROUND=$red
typeset -g POWERLEVEL9K_ZIG_VERSION_CONTENT_EXPANSION=' $(zig version)'
# If p10k is already loaded, reload configuration.
# This works even with POWERLEVEL9K_DISABLE_HOT_RELOAD=true.
(( ! $+functions[p10k] )) || p10k reload
}
# Tell `p10k configure` which file it should overwrite.
typeset -g POWERLEVEL9K_CONFIG_FILE=${${(%):-%x}:a}
(( ${#p10k_config_opts} )) && setopt ${p10k_config_opts[@]}
'builtin' 'unset' 'p10k_config_opts'