p10k.zsh 75 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480
  1. # Generated by Powerlevel10k configuration wizard on 2020-04-02 at 10:29 CEST.
  2. # Based on romkatv/powerlevel10k/config/p10k-lean.zsh, checksum 22558.
  3. # Wizard options: powerline, unicode, lean, 1 line, compact, concise, transient_prompt,
  4. # instant_prompt=verbose.
  5. # Type `p10k configure` to generate another config.
  6. #
  7. # Config for Powerlevel10k with lean prompt style. Type `p10k configure` to generate
  8. # your own config based on it.
  9. #
  10. # Tip: Looking for a nice color? Here's a one-liner to print colormap.
  11. #
  12. # for i in {0..255}; do print -Pn "%K{$i} %k%F{$i}${(l:3::0:)i}%f " ${${(M)$((i%6)):#3}:+$'\n'}; done
  13. # Temporarily change options.
  14. 'builtin' 'local' '-a' 'p10k_config_opts'
  15. [[ ! -o 'aliases' ]] || p10k_config_opts+=('aliases')
  16. [[ ! -o 'sh_glob' ]] || p10k_config_opts+=('sh_glob')
  17. [[ ! -o 'no_brace_expand' ]] || p10k_config_opts+=('no_brace_expand')
  18. 'builtin' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand'
  19. () {
  20. emulate -L zsh -o extended_glob
  21. # Unset all configuration options. This allows you to apply configuration changes without
  22. # restarting zsh. Edit ~/.p10k.zsh and type `source ~/.p10k.zsh`.
  23. unset -m 'POWERLEVEL9K_*'
  24. # Zsh >= 5.1 is required.
  25. autoload -Uz is-at-least && is-at-least 5.1 || return
  26. # The list of segments shown on the left. Fill it with the most important segments.
  27. typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(
  28. # os_icon # os identifier
  29. dir # current directory
  30. vcs # git status
  31. prompt_char # prompt symbol
  32. )
  33. # The list of segments shown on the right. Fill it with less important segments.
  34. # Right prompt on the last prompt line (where you are typing your commands) gets
  35. # automatically hidden when the input line reaches it. Right prompt above the
  36. # last prompt line gets hidden if it would overlap with left prompt.
  37. typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(
  38. status # exit code of the last command
  39. command_execution_time # duration of the last command
  40. background_jobs # presence of background jobs
  41. direnv # direnv status (https://direnv.net/)
  42. asdf # asdf version manager (https://github.com/asdf-vm/asdf)
  43. virtualenv # python virtual environment (https://docs.python.org/3/library/venv.html)
  44. anaconda # conda environment (https://conda.io/)
  45. pyenv # python environment (https://github.com/pyenv/pyenv)
  46. goenv # go environment (https://github.com/syndbg/goenv)
  47. nodenv # node.js version from nodenv (https://github.com/nodenv/nodenv)
  48. nvm # node.js version from nvm (https://github.com/nvm-sh/nvm)
  49. nodeenv # node.js environment (https://github.com/ekalinin/nodeenv)
  50. # node_version # node.js version
  51. # go_version # go version (https://golang.org)
  52. # rust_version # rustc version (https://www.rust-lang.org)
  53. # dotnet_version # .NET version (https://dotnet.microsoft.com)
  54. # php_version # php version (https://www.php.net/)
  55. # laravel_version # laravel php framework version (https://laravel.com/)
  56. # java_version # java version (https://www.java.com/)
  57. # package # name@version from package.json (https://docs.npmjs.com/files/package.json)
  58. rbenv # ruby version from rbenv (https://github.com/rbenv/rbenv)
  59. rvm # ruby version from rvm (https://rvm.io)
  60. fvm # flutter version management (https://github.com/leoafarias/fvm)
  61. luaenv # lua version from luaenv (https://github.com/cehoffman/luaenv)
  62. jenv # java version from jenv (https://github.com/jenv/jenv)
  63. plenv # perl version from plenv (https://github.com/tokuhirom/plenv)
  64. phpenv # php version from phpenv (https://github.com/phpenv/phpenv)
  65. haskell_stack # haskell version from stack (https://haskellstack.org/)
  66. kubecontext # current kubernetes context (https://kubernetes.io/)
  67. terraform # terraform workspace (https://www.terraform.io)
  68. aws # aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html)
  69. aws_eb_env # aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/)
  70. azure # azure account name (https://docs.microsoft.com/en-us/cli/azure)
  71. gcloud # google cloud cli account and project (https://cloud.google.com/)
  72. google_app_cred # google application credentials (https://cloud.google.com/docs/authentication/production)
  73. context # user@hostname
  74. nordvpn # nordvpn connection status, linux only (https://nordvpn.com/)
  75. ranger # ranger shell (https://github.com/ranger/ranger)
  76. nnn # nnn shell (https://github.com/jarun/nnn)
  77. vim_shell # vim shell indicator (:sh)
  78. midnight_commander # midnight commander shell (https://midnight-commander.org/)
  79. nix_shell # nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html)
  80. # vpn_ip # virtual private network indicator
  81. # load # CPU load
  82. # disk_usage # disk usage
  83. # ram # free RAM
  84. # swap # used swap
  85. todo # todo items (https://github.com/todotxt/todo.txt-cli)
  86. timewarrior # timewarrior tracking status (https://timewarrior.net/)
  87. taskwarrior # taskwarrior task count (https://taskwarrior.org/)
  88. # time # current time
  89. # ip # ip address and bandwidth usage for a specified network interface
  90. # public_ip # public IP address
  91. # proxy # system-wide http/https/ftp proxy
  92. # battery # internal battery
  93. # wifi # wifi speed
  94. # example # example user-defined segment (see prompt_example function below)
  95. )
  96. # Defines character set used by powerlevel10k. It's best to let `p10k configure` set it for you.
  97. typeset -g POWERLEVEL9K_MODE=powerline
  98. # When set to `moderate`, some icons will have an extra space after them. This is meant to avoid
  99. # icon overlap when using non-monospace fonts. When set to `none`, spaces are not added.
  100. typeset -g POWERLEVEL9K_ICON_PADDING=none
  101. # Basic style options that define the overall look of your prompt. You probably don't want to
  102. # change them.
  103. typeset -g POWERLEVEL9K_BACKGROUND= # transparent background
  104. typeset -g POWERLEVEL9K_{LEFT,RIGHT}_{LEFT,RIGHT}_WHITESPACE= # no surrounding whitespace
  105. typeset -g POWERLEVEL9K_{LEFT,RIGHT}_SUBSEGMENT_SEPARATOR=' ' # separate segments with a space
  106. typeset -g POWERLEVEL9K_{LEFT,RIGHT}_SEGMENT_SEPARATOR= # no end-of-line symbol
  107. # When set to true, icons appear before content on both sides of the prompt. When set
  108. # to false, icons go after content. If empty or not set, icons go before content in the left
  109. # prompt and after content in the right prompt.
  110. #
  111. # You can also override it for a specific segment:
  112. #
  113. # POWERLEVEL9K_STATUS_ICON_BEFORE_CONTENT=false
  114. #
  115. # Or for a specific segment in specific state:
  116. #
  117. # POWERLEVEL9K_DIR_NOT_WRITABLE_ICON_BEFORE_CONTENT=false
  118. typeset -g POWERLEVEL9K_ICON_BEFORE_CONTENT=true
  119. # Add an empty line before each prompt.
  120. typeset -g POWERLEVEL9K_PROMPT_ADD_NEWLINE=false
  121. # Connect left prompt lines with these symbols.
  122. typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX=
  123. typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_PREFIX=
  124. typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX=
  125. # Connect right prompt lines with these symbols.
  126. typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_SUFFIX=
  127. typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_SUFFIX=
  128. typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_SUFFIX=
  129. # The left end of left prompt.
  130. typeset -g POWERLEVEL9K_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL=
  131. # The right end of right prompt.
  132. typeset -g POWERLEVEL9K_RIGHT_PROMPT_LAST_SEGMENT_END_SYMBOL=
  133. # Ruler, a.k.a. the horizontal line before each prompt. If you set it to true, you'll
  134. # probably want to set POWERLEVEL9K_PROMPT_ADD_NEWLINE=false above and
  135. # POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR=' ' below.
  136. typeset -g POWERLEVEL9K_SHOW_RULER=false
  137. typeset -g POWERLEVEL9K_RULER_CHAR='─' # reasonable alternative: '·'
  138. typeset -g POWERLEVEL9K_RULER_FOREGROUND=242
  139. # Filler between left and right prompt on the first prompt line. You can set it to '·' or '─'
  140. # to make it easier to see the alignment between left and right prompt and to separate prompt
  141. # from command output. It serves the same purpose as ruler (see above) without increasing
  142. # the number of prompt lines. You'll probably want to set POWERLEVEL9K_SHOW_RULER=false
  143. # if using this. You might also like POWERLEVEL9K_PROMPT_ADD_NEWLINE=false for more compact
  144. # prompt.
  145. typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR=' '
  146. if [[ $POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR != ' ' ]]; then
  147. # The color of the filler.
  148. typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND=242
  149. # Add a space between the end of left prompt and the filler.
  150. typeset -g POWERLEVEL9K_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL=' '
  151. # Add a space between the filler and the start of right prompt.
  152. typeset -g POWERLEVEL9K_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL=' '
  153. # Start filler from the edge of the screen if there are no left segments on the first line.
  154. typeset -g POWERLEVEL9K_EMPTY_LINE_LEFT_PROMPT_FIRST_SEGMENT_END_SYMBOL='%{%}'
  155. # End filler on the edge of the screen if there are no right segments on the first line.
  156. typeset -g POWERLEVEL9K_EMPTY_LINE_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='%{%}'
  157. fi
  158. #################################[ os_icon: os identifier ]##################################
  159. # OS identifier color.
  160. typeset -g POWERLEVEL9K_OS_ICON_FOREGROUND=
  161. # Make the icon bold.
  162. typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION='${P9K_CONTENT}'
  163. ################################[ prompt_char: prompt symbol ]################################
  164. # Green prompt symbol if the last command succeeded.
  165. typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=76
  166. # Red prompt symbol if the last command failed.
  167. typeset -g POWERLEVEL9K_PROMPT_CHAR_ERROR_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=196
  168. # Default prompt symbol.
  169. typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIINS_CONTENT_EXPANSION='❯'
  170. # Prompt symbol in command vi mode.
  171. typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION='❮'
  172. # Prompt symbol in visual vi mode.
  173. typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='Ⅴ'
  174. # Prompt symbol in overwrite vi mode.
  175. typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIOWR_CONTENT_EXPANSION='▶'
  176. typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=true
  177. # No line terminator if prompt_char is the last segment.
  178. typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL=''
  179. # No line introducer if prompt_char is the first segment.
  180. typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL=
  181. ##################################[ dir: current directory ]##################################
  182. # Default current directory color.
  183. typeset -g POWERLEVEL9K_DIR_FOREGROUND=31
  184. # If directory is too long, shorten some of its segments to the shortest possible unique
  185. # prefix. The shortened directory can be tab-completed to the original.
  186. typeset -g POWERLEVEL9K_SHORTEN_STRATEGY=truncate_to_unique
  187. # Replace removed segment suffixes with this symbol.
  188. typeset -g POWERLEVEL9K_SHORTEN_DELIMITER=
  189. # Color of the shortened directory segments.
  190. typeset -g POWERLEVEL9K_DIR_SHORTENED_FOREGROUND=103
  191. # Color of the anchor directory segments. Anchor segments are never shortened. The first
  192. # segment is always an anchor.
  193. typeset -g POWERLEVEL9K_DIR_ANCHOR_FOREGROUND=39
  194. # Display anchor directory segments in bold.
  195. typeset -g POWERLEVEL9K_DIR_ANCHOR_BOLD=true
  196. # Don't shorten directories that contain any of these files. They are anchors.
  197. local anchor_files=(
  198. .bzr
  199. .citc
  200. .git
  201. .hg
  202. .node-version
  203. .python-version
  204. .go-version
  205. .ruby-version
  206. .lua-version
  207. .java-version
  208. .perl-version
  209. .php-version
  210. .tool-version
  211. .shorten_folder_marker
  212. .svn
  213. .terraform
  214. CVS
  215. Cargo.toml
  216. composer.json
  217. go.mod
  218. package.json
  219. stack.yaml
  220. )
  221. typeset -g POWERLEVEL9K_SHORTEN_FOLDER_MARKER="(${(j:|:)anchor_files})"
  222. # If set to true, remove everything before the last (deepest) subdirectory that contains files
  223. # matching $POWERLEVEL9K_SHORTEN_FOLDER_MARKER. For example, when the current directory is
  224. # /foo/bar/git_repo/baz, prompt will display git_repo/baz. This assumes that /foo/bar/git_repo
  225. # contains a marker (.git) and other directories don't.
  226. typeset -g POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER=false
  227. # Don't shorten this many last directory segments. They are anchors.
  228. typeset -g POWERLEVEL9K_SHORTEN_DIR_LENGTH=1
  229. # Shorten directory if it's longer than this even if there is space for it. The value can
  230. # be either absolute (e.g., '80') or a percentage of terminal width (e.g, '50%'). If empty,
  231. # directory will be shortened only when prompt doesn't fit or when other parameters demand it
  232. # (see POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS and POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT below).
  233. # If set to `0`, directory will always be shortened to its minimum length.
  234. typeset -g POWERLEVEL9K_DIR_MAX_LENGTH=80
  235. # When `dir` segment is on the last prompt line, try to shorten it enough to leave at least this
  236. # many columns for typing commands.
  237. typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS=40
  238. # When `dir` segment is on the last prompt line, try to shorten it enough to leave at least
  239. # COLUMNS * POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT * 0.01 columns for typing commands.
  240. typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT=50
  241. # If set to true, embed a hyperlink into the directory. Useful for quickly
  242. # opening a directory in the file manager simply by clicking the link.
  243. # Can also be handy when the directory is shortened, as it allows you to see
  244. # the full directory that was used in previous commands.
  245. typeset -g POWERLEVEL9K_DIR_HYPERLINK=false
  246. # Enable special styling for non-writable directories.
  247. typeset -g POWERLEVEL9K_DIR_SHOW_WRITABLE=true
  248. # Show this icon when the current directory is not writable. POWERLEVEL9K_DIR_SHOW_WRITABLE
  249. # above must be set to true for this parameter to have effect.
  250. typeset -g POWERLEVEL9K_DIR_NOT_WRITABLE_VISUAL_IDENTIFIER_EXPANSION='∅'
  251. # Custom prefix.
  252. # typeset -g POWERLEVEL9K_DIR_PREFIX='%fin '
  253. # POWERLEVEL9K_DIR_CLASSES allows you to specify custom icons for different directories.
  254. # It must be an array with 3 * N elements. Each triplet consists of:
  255. #
  256. # 1. A pattern against which the current directory is matched. Matching is done with
  257. # extended_glob option enabled.
  258. # 2. Directory class for the purpose of styling.
  259. # 3. Icon.
  260. #
  261. # Triplets are tried in order. The first triplet whose pattern matches $PWD wins. If there
  262. # are no matches, the directory will have no icon.
  263. #
  264. # Example:
  265. #
  266. # typeset -g POWERLEVEL9K_DIR_CLASSES=(
  267. # '~/work(|/*)' WORK '(╯°□°)╯︵ ┻━┻'
  268. # '~(|/*)' HOME '⌂'
  269. # '*' DEFAULT '')
  270. #
  271. # With these settings, the current directory in the prompt may look like this:
  272. #
  273. # (╯°□°)╯︵ ┻━┻ ~/work/projects/important/urgent
  274. #
  275. # Or like this:
  276. #
  277. # ⌂ ~/best/powerlevel10k
  278. #
  279. # You can also set different colors for directories of different classes. Remember to override
  280. # FOREGROUND, SHORTENED_FOREGROUND and ANCHOR_FOREGROUND for every directory class that you wish
  281. # to have its own color.
  282. #
  283. # typeset -g POWERLEVEL9K_DIR_WORK_FOREGROUND=31
  284. # typeset -g POWERLEVEL9K_DIR_WORK_SHORTENED_FOREGROUND=103
  285. # typeset -g POWERLEVEL9K_DIR_WORK_ANCHOR_FOREGROUND=39
  286. #
  287. typeset -g POWERLEVEL9K_DIR_CLASSES=()
  288. #####################################[ vcs: git status ]######################################
  289. # Branch icon. Set this parameter to '\uF126 ' for the popular Powerline branch icon.
  290. typeset -g POWERLEVEL9K_VCS_BRANCH_ICON=
  291. # Untracked files icon. It's really a question mark, your font isn't broken.
  292. # Change the value of this parameter to show a different icon.
  293. typeset -g POWERLEVEL9K_VCS_UNTRACKED_ICON='?'
  294. # Formatter for Git status.
  295. #
  296. # Example output: master ⇣42⇡42 *42 merge ~42 +42 !42 ?42.
  297. #
  298. # You can edit the function to customize how Git status looks.
  299. #
  300. # VCS_STATUS_* parameters are set by gitstatus plugin. See reference:
  301. # https://github.com/romkatv/gitstatus/blob/master/gitstatus.plugin.zsh.
  302. function my_git_formatter() {
  303. emulate -L zsh
  304. if [[ -n $P9K_CONTENT ]]; then
  305. # If P9K_CONTENT is not empty, use it. It's either "loading" or from vcs_info (not from
  306. # gitstatus plugin). VCS_STATUS_* parameters are not available in this case.
  307. typeset -g my_git_format=$P9K_CONTENT
  308. return
  309. fi
  310. if (( $1 )); then
  311. # Styling for up-to-date Git status.
  312. local meta='%f' # default foreground
  313. local clean='%76F' # green foreground
  314. local modified='%178F' # yellow foreground
  315. local untracked='%39F' # blue foreground
  316. local conflicted='%196F' # red foreground
  317. else
  318. # Styling for incomplete and stale Git status.
  319. local meta='%244F' # grey foreground
  320. local clean='%244F' # grey foreground
  321. local modified='%244F' # grey foreground
  322. local untracked='%244F' # grey foreground
  323. local conflicted='%244F' # grey foreground
  324. fi
  325. local res
  326. local where # branch or tag
  327. if [[ -n $VCS_STATUS_LOCAL_BRANCH ]]; then
  328. res+="${clean}${(g::)POWERLEVEL9K_VCS_BRANCH_ICON}"
  329. where=${(V)VCS_STATUS_LOCAL_BRANCH}
  330. elif [[ -n $VCS_STATUS_TAG ]]; then
  331. res+="${meta}#"
  332. where=${(V)VCS_STATUS_TAG}
  333. fi
  334. # If local branch name or tag is at most 32 characters long, show it in full.
  335. # Otherwise show the first 12 … the last 12.
  336. (( $#where > 32 )) && where[13,-13]="…"
  337. res+="${clean}${where//\%/%%}" # escape %
  338. # Display the current Git commit if there is no branch or tag.
  339. # Tip: To always display the current Git commit, remove `[[ -z $where ]] &&` from the next line.
  340. [[ -z $where ]] && res+="${meta}@${clean}${VCS_STATUS_COMMIT[1,8]}"
  341. # Show tracking branch name if it differs from local branch.
  342. if [[ -n ${VCS_STATUS_REMOTE_BRANCH:#$VCS_STATUS_LOCAL_BRANCH} ]]; then
  343. res+="${meta}:${clean}${(V)VCS_STATUS_REMOTE_BRANCH//\%/%%}" # escape %
  344. fi
  345. # ⇣42 if behind the remote.
  346. (( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}⇣${VCS_STATUS_COMMITS_BEHIND}"
  347. # ⇡42 if ahead of the remote; no leading space if also behind the remote: ⇣42⇡42.
  348. (( VCS_STATUS_COMMITS_AHEAD && !VCS_STATUS_COMMITS_BEHIND )) && res+=" "
  349. (( VCS_STATUS_COMMITS_AHEAD )) && res+="${clean}⇡${VCS_STATUS_COMMITS_AHEAD}"
  350. # ⇠42 if behind the push remote.
  351. (( VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" ${clean}⇠${VCS_STATUS_PUSH_COMMITS_BEHIND}"
  352. (( VCS_STATUS_PUSH_COMMITS_AHEAD && !VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" "
  353. # ⇢42 if ahead of the push remote; no leading space if also behind: ⇠42⇢42.
  354. (( VCS_STATUS_PUSH_COMMITS_AHEAD )) && res+="${clean}⇢${VCS_STATUS_PUSH_COMMITS_AHEAD}"
  355. # *42 if have stashes.
  356. (( VCS_STATUS_STASHES )) && res+=" ${clean}*${VCS_STATUS_STASHES}"
  357. # 'merge' if the repo is in an unusual state.
  358. [[ -n $VCS_STATUS_ACTION ]] && res+=" ${conflicted}${VCS_STATUS_ACTION}"
  359. # ~42 if have merge conflicts.
  360. (( VCS_STATUS_NUM_CONFLICTED )) && res+=" ${conflicted}~${VCS_STATUS_NUM_CONFLICTED}"
  361. # +42 if have staged changes.
  362. (( VCS_STATUS_NUM_STAGED )) && res+=" ${modified}+${VCS_STATUS_NUM_STAGED}"
  363. # !42 if have unstaged changes.
  364. (( VCS_STATUS_NUM_UNSTAGED )) && res+=" ${modified}!${VCS_STATUS_NUM_UNSTAGED}"
  365. # ?42 if have untracked files. It's really a question mark, your font isn't broken.
  366. # See POWERLEVEL9K_VCS_UNTRACKED_ICON above if you want to use a different icon.
  367. # Remove the next line if you don't want to see untracked files at all.
  368. (( VCS_STATUS_NUM_UNTRACKED )) && res+=" ${untracked}${(g::)POWERLEVEL9K_VCS_UNTRACKED_ICON}${VCS_STATUS_NUM_UNTRACKED}"
  369. # "─" if the number of unstaged files is unknown. This can happen due to
  370. # POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY (see below) being set to a non-negative number lower
  371. # than the number of files in the Git index, or due to bash.showDirtyState being set to false
  372. # in the repository config. The number of staged and untracked files may also be unknown
  373. # in this case.
  374. (( VCS_STATUS_HAS_UNSTAGED == -1 )) && res+=" ${modified}─"
  375. typeset -g my_git_format=$res
  376. }
  377. functions -M my_git_formatter 2>/dev/null
  378. # Don't count the number of unstaged, untracked and conflicted files in Git repositories with
  379. # more than this many files in the index. Negative value means infinity.
  380. #
  381. # If you are working in Git repositories with tens of millions of files and seeing performance
  382. # sagging, try setting POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY to a number lower than the output
  383. # of `git ls-files | wc -l`. Alternatively, add `bash.showDirtyState = false` to the repository's
  384. # config: `git config bash.showDirtyState false`.
  385. typeset -g POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY=-1
  386. # Don't show Git status in prompt for repositories whose workdir matches this pattern.
  387. # For example, if set to '~', the Git repository at $HOME/.git will be ignored.
  388. # Multiple patterns can be combined with '|': '~|~/some/dir'.
  389. typeset -g POWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN='~'
  390. # Disable the default Git status formatting.
  391. typeset -g POWERLEVEL9K_VCS_DISABLE_GITSTATUS_FORMATTING=true
  392. # Install our own Git status formatter.
  393. typeset -g POWERLEVEL9K_VCS_CONTENT_EXPANSION='${$((my_git_formatter(1)))+${my_git_format}}'
  394. typeset -g POWERLEVEL9K_VCS_LOADING_CONTENT_EXPANSION='${$((my_git_formatter(0)))+${my_git_format}}'
  395. # Enable counters for staged, unstaged, etc.
  396. typeset -g POWERLEVEL9K_VCS_{STAGED,UNSTAGED,UNTRACKED,CONFLICTED,COMMITS_AHEAD,COMMITS_BEHIND}_MAX_NUM=-1
  397. # Icon color.
  398. typeset -g POWERLEVEL9K_VCS_VISUAL_IDENTIFIER_COLOR=76
  399. typeset -g POWERLEVEL9K_VCS_LOADING_VISUAL_IDENTIFIER_COLOR=244
  400. # Custom icon.
  401. typeset -g POWERLEVEL9K_VCS_VISUAL_IDENTIFIER_EXPANSION=
  402. # Custom prefix.
  403. # typeset -g POWERLEVEL9K_VCS_PREFIX='%fon '
  404. # Show status of repositories of these types. You can add svn and/or hg if you are
  405. # using them. If you do, your prompt may become slow even when your current directory
  406. # isn't in an svn or hg reposotiry.
  407. typeset -g POWERLEVEL9K_VCS_BACKENDS=(git)
  408. # These settings are used for respositories other than Git or when gitstatusd fails and
  409. # Powerlevel10k has to fall back to using vcs_info.
  410. typeset -g POWERLEVEL9K_VCS_CLEAN_FOREGROUND=76
  411. typeset -g POWERLEVEL9K_VCS_UNTRACKED_FOREGROUND=76
  412. typeset -g POWERLEVEL9K_VCS_MODIFIED_FOREGROUND=178
  413. ##########################[ status: exit code of the last command ]###########################
  414. # Enable OK_PIPE, ERROR_PIPE and ERROR_SIGNAL status states to allow us to enable, disable and
  415. # style them independently from the regular OK and ERROR state.
  416. typeset -g POWERLEVEL9K_STATUS_EXTENDED_STATES=true
  417. # Status on success. No content, just an icon. No need to show it if prompt_char is enabled as
  418. # it will signify success by turning green.
  419. typeset -g POWERLEVEL9K_STATUS_OK=false
  420. typeset -g POWERLEVEL9K_STATUS_OK_FOREGROUND=70
  421. typeset -g POWERLEVEL9K_STATUS_OK_VISUAL_IDENTIFIER_EXPANSION='✔'
  422. # Status when some part of a pipe command fails but the overall exit status is zero. It may look
  423. # like this: 1|0.
  424. typeset -g POWERLEVEL9K_STATUS_OK_PIPE=true
  425. typeset -g POWERLEVEL9K_STATUS_OK_PIPE_FOREGROUND=70
  426. typeset -g POWERLEVEL9K_STATUS_OK_PIPE_VISUAL_IDENTIFIER_EXPANSION='✔'
  427. # Status when it's just an error code (e.g., '1'). No need to show it if prompt_char is enabled as
  428. # it will signify error by turning red.
  429. typeset -g POWERLEVEL9K_STATUS_ERROR=false
  430. typeset -g POWERLEVEL9K_STATUS_ERROR_FOREGROUND=160
  431. typeset -g POWERLEVEL9K_STATUS_ERROR_VISUAL_IDENTIFIER_EXPANSION='✘'
  432. # Status when the last command was terminated by a signal.
  433. typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL=true
  434. typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_FOREGROUND=160
  435. # Use terse signal names: "INT" instead of "SIGINT(2)".
  436. typeset -g POWERLEVEL9K_STATUS_VERBOSE_SIGNAME=false
  437. typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_VISUAL_IDENTIFIER_EXPANSION='✘'
  438. # Status when some part of a pipe command fails and the overall exit status is also non-zero.
  439. # It may look like this: 1|0.
  440. typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE=true
  441. typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_FOREGROUND=160
  442. typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_VISUAL_IDENTIFIER_EXPANSION='✘'
  443. ###################[ command_execution_time: duration of the last command ]###################
  444. # Show duration of the last command if takes longer than this many seconds.
  445. typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=3
  446. # Show this many fractional digits. Zero means round to seconds.
  447. typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0
  448. # Execution time color.
  449. typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND=101
  450. # Duration format: 1d 2h 3m 4s.
  451. typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FORMAT='d h m s'
  452. # Custom icon.
  453. typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_VISUAL_IDENTIFIER_EXPANSION=
  454. # Custom prefix.
  455. # typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PREFIX='%ftook '
  456. #######################[ background_jobs: presence of background jobs ]#######################
  457. # Don't show the number of background jobs.
  458. typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE=false
  459. # Background jobs color.
  460. typeset -g POWERLEVEL9K_BACKGROUND_JOBS_FOREGROUND=70
  461. # Custom icon.
  462. typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VISUAL_IDENTIFIER_EXPANSION='≡'
  463. #######################[ direnv: direnv status (https://direnv.net/) ]########################
  464. # Direnv color.
  465. typeset -g POWERLEVEL9K_DIRENV_FOREGROUND=178
  466. # Custom icon.
  467. # typeset -g POWERLEVEL9K_DIRENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
  468. ###############[ asdf: asdf version manager (https://github.com/asdf-vm/asdf) ]###############
  469. # Default asdf color. Only used to display tools for which there is no color override (see below).
  470. typeset -g POWERLEVEL9K_ASDF_FOREGROUND=66
  471. # There are four parameters that can be used to hide asdf tools. Each parameter describes
  472. # conditions under which a tool gets hidden. Parameters can hide tools but not unhide them. If at
  473. # least one parameter decides to hide a tool, that tool gets hidden. If no parameter decides to
  474. # hide a tool, it gets shown.
  475. #
  476. # Special note on the difference between POWERLEVEL9K_ASDF_SOURCES and
  477. # POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW. Consider the effect of the following commands:
  478. #
  479. # asdf local python 3.8.1
  480. # asdf global python 3.8.1
  481. #
  482. # After running both commands the current python version is 3.8.1 and its source is "local" as
  483. # it takes precedence over "global". If POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW is set to false,
  484. # it'll hide python version in this case because 3.8.1 is the same as the global version.
  485. # POWERLEVEL9K_ASDF_SOURCES will hide python version only if the value of this parameter doesn't
  486. # contain "local".
  487. # Hide tool versions that don't come from one of these sources.
  488. #
  489. # Available sources:
  490. #
  491. # - shell `asdf current` says "set by ASDF_${TOOL}_VERSION environment variable"
  492. # - local `asdf current` says "set by /some/not/home/directory/file"
  493. # - global `asdf current` says "set by /home/username/file"
  494. #
  495. # Note: If this parameter is set to (shell local global), it won't hide tools.
  496. # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SOURCES.
  497. typeset -g POWERLEVEL9K_ASDF_SOURCES=(shell local global)
  498. # If set to false, hide tool versions that are the same as global.
  499. #
  500. # Note: The name of this parameter doesn't reflect its meaning at all.
  501. # Note: If this parameter is set to true, it won't hide tools.
  502. # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_PROMPT_ALWAYS_SHOW.
  503. typeset -g POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW=false
  504. # If set to false, hide tool versions that are equal to "system".
  505. #
  506. # Note: If this parameter is set to true, it won't hide tools.
  507. # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SHOW_SYSTEM.
  508. typeset -g POWERLEVEL9K_ASDF_SHOW_SYSTEM=true
  509. # If set to non-empty value, hide tools unless there is a file matching the specified file pattern
  510. # in the current directory, or its parent diretory, or its grandparent directory, and so on.
  511. #
  512. # Note: If this parameter is set to empty value, it won't hide tools.
  513. # Note: SHOW_ON_UPGLOB isn't specific to asdf. It works with all prompt segments.
  514. # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SHOW_ON_UPGLOB.
  515. #
  516. # Example: Hide nodejs version when there is no package.json and no *.js files in the current
  517. # directory, in `..`, in `../..` and so on.
  518. #
  519. # typeset -g POWERLEVEL9K_ASDF_NODEJS_SHOW_ON_UPGLOB='*.js|package.json'
  520. typeset -g POWERLEVEL9K_ASDF_SHOW_ON_UPGLOB=
  521. # Ruby version from asdf.
  522. typeset -g POWERLEVEL9K_ASDF_RUBY_FOREGROUND=168
  523. # typeset -g POWERLEVEL9K_ASDF_RUBY_VISUAL_IDENTIFIER_EXPANSION='⭐'
  524. # typeset -g POWERLEVEL9K_ASDF_RUBY_SHOW_ON_UPGLOB='*.foo|*.bar'
  525. # Python version from asdf.
  526. typeset -g POWERLEVEL9K_ASDF_PYTHON_FOREGROUND=37
  527. # typeset -g POWERLEVEL9K_ASDF_PYTHON_VISUAL_IDENTIFIER_EXPANSION='⭐'
  528. # typeset -g POWERLEVEL9K_ASDF_PYTHON_SHOW_ON_UPGLOB='*.foo|*.bar'
  529. # Go version from asdf.
  530. typeset -g POWERLEVEL9K_ASDF_GOLANG_FOREGROUND=37
  531. # typeset -g POWERLEVEL9K_ASDF_GOLANG_VISUAL_IDENTIFIER_EXPANSION='⭐'
  532. # typeset -g POWERLEVEL9K_ASDF_GOLANG_SHOW_ON_UPGLOB='*.foo|*.bar'
  533. # Node.js version from asdf.
  534. typeset -g POWERLEVEL9K_ASDF_NODEJS_FOREGROUND=70
  535. # typeset -g POWERLEVEL9K_ASDF_NODEJS_VISUAL_IDENTIFIER_EXPANSION='⭐'
  536. # typeset -g POWERLEVEL9K_ASDF_NODEJS_SHOW_ON_UPGLOB='*.foo|*.bar'
  537. # Rust version from asdf.
  538. typeset -g POWERLEVEL9K_ASDF_RUST_FOREGROUND=37
  539. # typeset -g POWERLEVEL9K_ASDF_RUST_VISUAL_IDENTIFIER_EXPANSION='⭐'
  540. # typeset -g POWERLEVEL9K_ASDF_RUST_SHOW_ON_UPGLOB='*.foo|*.bar'
  541. # .NET Core version from asdf.
  542. typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_FOREGROUND=134
  543. # typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_VISUAL_IDENTIFIER_EXPANSION='⭐'
  544. # typeset -g POWERLEVEL9K_ASDF_DOTNET_SHOW_ON_UPGLOB='*.foo|*.bar'
  545. # Flutter version from asdf.
  546. typeset -g POWERLEVEL9K_ASDF_FLUTTER_FOREGROUND=38
  547. # typeset -g POWERLEVEL9K_ASDF_FLUTTER_VISUAL_IDENTIFIER_EXPANSION='⭐'
  548. # typeset -g POWERLEVEL9K_ASDF_FLUTTER_SHOW_ON_UPGLOB='*.foo|*.bar'
  549. # Lua version from asdf.
  550. typeset -g POWERLEVEL9K_ASDF_LUA_FOREGROUND=32
  551. # typeset -g POWERLEVEL9K_ASDF_LUA_VISUAL_IDENTIFIER_EXPANSION='⭐'
  552. # typeset -g POWERLEVEL9K_ASDF_LUA_SHOW_ON_UPGLOB='*.foo|*.bar'
  553. # Java version from asdf.
  554. typeset -g POWERLEVEL9K_ASDF_JAVA_FOREGROUND=32
  555. # typeset -g POWERLEVEL9K_ASDF_JAVA_VISUAL_IDENTIFIER_EXPANSION='⭐'
  556. # typeset -g POWERLEVEL9K_ASDF_JAVA_SHOW_ON_UPGLOB='*.foo|*.bar'
  557. # Perl version from asdf.
  558. typeset -g POWERLEVEL9K_ASDF_PERL_FOREGROUND=67
  559. # typeset -g POWERLEVEL9K_ASDF_PERL_VISUAL_IDENTIFIER_EXPANSION='⭐'
  560. # typeset -g POWERLEVEL9K_ASDF_PERL_SHOW_ON_UPGLOB='*.foo|*.bar'
  561. # Erlang version from asdf.
  562. typeset -g POWERLEVEL9K_ASDF_ERLANG_FOREGROUND=125
  563. # typeset -g POWERLEVEL9K_ASDF_ERLANG_VISUAL_IDENTIFIER_EXPANSION='⭐'
  564. # typeset -g POWERLEVEL9K_ASDF_ERLANG_SHOW_ON_UPGLOB='*.foo|*.bar'
  565. # Elixir version from asdf.
  566. typeset -g POWERLEVEL9K_ASDF_ELIXIR_FOREGROUND=129
  567. # typeset -g POWERLEVEL9K_ASDF_ELIXIR_VISUAL_IDENTIFIER_EXPANSION='⭐'
  568. # typeset -g POWERLEVEL9K_ASDF_ELIXIR_SHOW_ON_UPGLOB='*.foo|*.bar'
  569. # Postgres version from asdf.
  570. typeset -g POWERLEVEL9K_ASDF_POSTGRES_FOREGROUND=31
  571. # typeset -g POWERLEVEL9K_ASDF_POSTGRES_VISUAL_IDENTIFIER_EXPANSION='⭐'
  572. # typeset -g POWERLEVEL9K_ASDF_POSTGRES_SHOW_ON_UPGLOB='*.foo|*.bar'
  573. # PHP version from asdf.
  574. typeset -g POWERLEVEL9K_ASDF_PHP_FOREGROUND=99
  575. # typeset -g POWERLEVEL9K_ASDF_PHP_VISUAL_IDENTIFIER_EXPANSION='⭐'
  576. # typeset -g POWERLEVEL9K_ASDF_PHP_SHOW_ON_UPGLOB='*.foo|*.bar'
  577. # Haskell version from asdf.
  578. typeset -g POWERLEVEL9K_ASDF_HASKELL_FOREGROUND=172
  579. # typeset -g POWERLEVEL9K_ASDF_HASKELL_VISUAL_IDENTIFIER_EXPANSION='⭐'
  580. # typeset -g POWERLEVEL9K_ASDF_HASKELL_SHOW_ON_UPGLOB='*.foo|*.bar'
  581. ##########[ nordvpn: nordvpn connection status, linux only (https://nordvpn.com/) ]###########
  582. # NordVPN connection indicator color.
  583. typeset -g POWERLEVEL9K_NORDVPN_FOREGROUND=39
  584. # Hide NordVPN connection indicator when not connected.
  585. typeset -g POWERLEVEL9K_NORDVPN_{DISCONNECTED,CONNECTING,DISCONNECTING}_CONTENT_EXPANSION=
  586. typeset -g POWERLEVEL9K_NORDVPN_{DISCONNECTED,CONNECTING,DISCONNECTING}_VISUAL_IDENTIFIER_EXPANSION=
  587. # Custom icon.
  588. # typeset -g POWERLEVEL9K_NORDVPN_VISUAL_IDENTIFIER_EXPANSION='⭐'
  589. #################[ ranger: ranger shell (https://github.com/ranger/ranger) ]##################
  590. # Ranger shell color.
  591. typeset -g POWERLEVEL9K_RANGER_FOREGROUND=178
  592. # Custom icon.
  593. typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='▲'
  594. ######################[ nnn: nnn shell (https://github.com/jarun/nnn) ]#######################
  595. # Nnn shell color.
  596. typeset -g POWERLEVEL9K_NNN_FOREGROUND=72
  597. # Custom icon.
  598. # typeset -g POWERLEVEL9K_NNN_VISUAL_IDENTIFIER_EXPANSION='⭐'
  599. ###########################[ vim_shell: vim shell indicator (:sh) ]###########################
  600. # Vim shell indicator color.
  601. typeset -g POWERLEVEL9K_VIM_SHELL_FOREGROUND=34
  602. # Custom icon.
  603. # typeset -g POWERLEVEL9K_VIM_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐'
  604. ######[ midnight_commander: midnight commander shell (https://midnight-commander.org/) ]######
  605. # Midnight Commander shell color.
  606. typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_FOREGROUND=178
  607. # Custom icon.
  608. # typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_VISUAL_IDENTIFIER_EXPANSION='⭐'
  609. #[ nix_shell: nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) ]##
  610. # Nix shell color.
  611. typeset -g POWERLEVEL9K_NIX_SHELL_FOREGROUND=74
  612. # Tip: If you want to see just the icon without "pure" and "impure", uncomment the next line.
  613. # typeset -g POWERLEVEL9K_NIX_SHELL_CONTENT_EXPANSION=
  614. # Custom icon.
  615. # typeset -g POWERLEVEL9K_NIX_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐'
  616. ##################################[ disk_usage: disk usage ]##################################
  617. # Colors for different levels of disk usage.
  618. typeset -g POWERLEVEL9K_DISK_USAGE_NORMAL_FOREGROUND=35
  619. typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_FOREGROUND=220
  620. typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_FOREGROUND=160
  621. # Thresholds for different levels of disk usage (percentage points).
  622. typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_LEVEL=90
  623. typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_LEVEL=95
  624. # If set to true, hide disk usage when below $POWERLEVEL9K_DISK_USAGE_WARNING_LEVEL percent.
  625. typeset -g POWERLEVEL9K_DISK_USAGE_ONLY_WARNING=false
  626. # Custom icon.
  627. # typeset -g POWERLEVEL9K_DISK_USAGE_VISUAL_IDENTIFIER_EXPANSION='⭐'
  628. ######################################[ ram: free RAM ]#######################################
  629. # RAM color.
  630. typeset -g POWERLEVEL9K_RAM_FOREGROUND=66
  631. # Custom icon.
  632. # typeset -g POWERLEVEL9K_RAM_VISUAL_IDENTIFIER_EXPANSION='⭐'
  633. #####################################[ swap: used swap ]######################################
  634. # Swap color.
  635. typeset -g POWERLEVEL9K_SWAP_FOREGROUND=96
  636. # Custom icon.
  637. # typeset -g POWERLEVEL9K_SWAP_VISUAL_IDENTIFIER_EXPANSION='⭐'
  638. ######################################[ load: CPU load ]######################################
  639. # Show average CPU load over this many last minutes. Valid values are 1, 5 and 15.
  640. typeset -g POWERLEVEL9K_LOAD_WHICH=5
  641. # Load color when load is under 50%.
  642. typeset -g POWERLEVEL9K_LOAD_NORMAL_FOREGROUND=66
  643. # Load color when load is between 50% and 70%.
  644. typeset -g POWERLEVEL9K_LOAD_WARNING_FOREGROUND=178
  645. # Load color when load is over 70%.
  646. typeset -g POWERLEVEL9K_LOAD_CRITICAL_FOREGROUND=166
  647. # Custom icon.
  648. # typeset -g POWERLEVEL9K_LOAD_VISUAL_IDENTIFIER_EXPANSION='⭐'
  649. ################[ todo: todo items (https://github.com/todotxt/todo.txt-cli) ]################
  650. # Todo color.
  651. typeset -g POWERLEVEL9K_TODO_FOREGROUND=110
  652. # Hide todo when the total number of tasks is zero.
  653. typeset -g POWERLEVEL9K_TODO_HIDE_ZERO_TOTAL=true
  654. # Hide todo when the number of tasks after filtering is zero.
  655. typeset -g POWERLEVEL9K_TODO_HIDE_ZERO_FILTERED=false
  656. # Todo format. The following parameters are available within the expansion.
  657. #
  658. # - P9K_TODO_TOTAL_TASK_COUNT The total number of tasks.
  659. # - P9K_TODO_FILTERED_TASK_COUNT The number of tasks after filtering.
  660. #
  661. # These variables correspond to the last line of the output of `todo.sh -p ls`:
  662. #
  663. # TODO: 24 of 42 tasks shown
  664. #
  665. # Here 24 is P9K_TODO_FILTERED_TASK_COUNT and 42 is P9K_TODO_TOTAL_TASK_COUNT.
  666. #
  667. # typeset -g POWERLEVEL9K_TODO_CONTENT_EXPANSION='$P9K_TODO_FILTERED_TASK_COUNT'
  668. # Custom icon.
  669. # typeset -g POWERLEVEL9K_TODO_VISUAL_IDENTIFIER_EXPANSION='⭐'
  670. ###########[ timewarrior: timewarrior tracking status (https://timewarrior.net/) ]############
  671. # Timewarrior color.
  672. typeset -g POWERLEVEL9K_TIMEWARRIOR_FOREGROUND=110
  673. # If the tracked task is longer than 24 characters, truncate and append "…".
  674. # Tip: To always display tasks without truncation, delete the following parameter.
  675. # Tip: To hide task names and display just the icon when time tracking is enabled, set the
  676. # value of the following parameter to "".
  677. typeset -g POWERLEVEL9K_TIMEWARRIOR_CONTENT_EXPANSION='${P9K_CONTENT:0:24}${${P9K_CONTENT:24}:+…}'
  678. # Custom icon.
  679. # typeset -g POWERLEVEL9K_TIMEWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐'
  680. ##############[ taskwarrior: taskwarrior task count (https://taskwarrior.org/) ]##############
  681. # Taskwarrior color.
  682. typeset -g POWERLEVEL9K_TASKWARRIOR_FOREGROUND=74
  683. # Taskwarrior segment format. The following parameters are available within the expansion.
  684. #
  685. # - P9K_TASKWARRIOR_PENDING_COUNT The number of pending tasks: `task +PENDING count`.
  686. # - P9K_TASKWARRIOR_OVERDUE_COUNT The number of overdue tasks: `task +OVERDUE count`.
  687. #
  688. # Zero values are represented as empty parameters.
  689. #
  690. # The default format:
  691. #
  692. # '${P9K_TASKWARRIOR_OVERDUE_COUNT:+"!$P9K_TASKWARRIOR_OVERDUE_COUNT/"}$P9K_TASKWARRIOR_PENDING_COUNT'
  693. #
  694. # typeset -g POWERLEVEL9K_TASKWARRIOR_CONTENT_EXPANSION='$P9K_TASKWARRIOR_PENDING_COUNT'
  695. # Custom icon.
  696. # typeset -g POWERLEVEL9K_TASKWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐'
  697. ##################################[ context: user@hostname ]##################################
  698. # Context color when running with privileges.
  699. typeset -g POWERLEVEL9K_CONTEXT_ROOT_FOREGROUND=178
  700. # Context color in SSH without privileges.
  701. typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_FOREGROUND=180
  702. # Default context color (no privileges, no SSH).
  703. typeset -g POWERLEVEL9K_CONTEXT_FOREGROUND=180
  704. # Context format when running with privileges: bold user@hostname.
  705. typeset -g POWERLEVEL9K_CONTEXT_ROOT_TEMPLATE='%B%n@%m'
  706. # Context format when in SSH without privileges: user@hostname.
  707. typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_TEMPLATE='%n@%m'
  708. # Default context format (no privileges, no SSH): user@hostname.
  709. typeset -g POWERLEVEL9K_CONTEXT_TEMPLATE='%n@%m'
  710. # Don't show context unless running with privileges or in SSH.
  711. # Tip: Remove the next line to always show context.
  712. typeset -g POWERLEVEL9K_CONTEXT_{DEFAULT,SUDO}_{CONTENT,VISUAL_IDENTIFIER}_EXPANSION=
  713. # Custom icon.
  714. # typeset -g POWERLEVEL9K_CONTEXT_VISUAL_IDENTIFIER_EXPANSION='⭐'
  715. # Custom prefix.
  716. # typeset -g POWERLEVEL9K_CONTEXT_PREFIX='%fwith '
  717. ###[ virtualenv: python virtual environment (https://docs.python.org/3/library/venv.html) ]###
  718. # Python virtual environment color.
  719. typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=37
  720. # Don't show Python version next to the virtual environment name.
  721. typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=false
  722. # Separate environment name from Python version only with a space.
  723. typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER=
  724. # Custom icon.
  725. # typeset -g POWERLEVEL9K_VIRTUALENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
  726. #####################[ anaconda: conda environment (https://conda.io/) ]######################
  727. # Anaconda environment color.
  728. typeset -g POWERLEVEL9K_ANACONDA_FOREGROUND=37
  729. # Don't show Python version next to the anaconda environment name.
  730. typeset -g POWERLEVEL9K_ANACONDA_SHOW_PYTHON_VERSION=false
  731. # Separate environment name from Python version only with a space.
  732. typeset -g POWERLEVEL9K_ANACONDA_{LEFT,RIGHT}_DELIMITER=
  733. # Custom icon.
  734. # typeset -g POWERLEVEL9K_ANACONDA_VISUAL_IDENTIFIER_EXPANSION='⭐'
  735. ################[ pyenv: python environment (https://github.com/pyenv/pyenv) ]################
  736. # Pyenv color.
  737. typeset -g POWERLEVEL9K_PYENV_FOREGROUND=37
  738. # Hide python version if it doesn't come from one of these sources.
  739. typeset -g POWERLEVEL9K_PYENV_SOURCES=(shell local global)
  740. # If set to false, hide python version if it's the same as global:
  741. # $(pyenv version-name) == $(pyenv global).
  742. typeset -g POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW=false
  743. # If set to false, hide python version if it's equal to "system".
  744. typeset -g POWERLEVEL9K_PYENV_SHOW_SYSTEM=true
  745. # Custom icon.
  746. # typeset -g POWERLEVEL9K_PYENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
  747. ################[ goenv: go environment (https://github.com/syndbg/goenv) ]################
  748. # Goenv color.
  749. typeset -g POWERLEVEL9K_GOENV_FOREGROUND=37
  750. # Hide go version if it doesn't come from one of these sources.
  751. typeset -g POWERLEVEL9K_GOENV_SOURCES=(shell local global)
  752. # If set to false, hide go version if it's the same as global:
  753. # $(goenv version-name) == $(goenv global).
  754. typeset -g POWERLEVEL9K_GOENV_PROMPT_ALWAYS_SHOW=false
  755. # If set to false, hide go version if it's equal to "system".
  756. typeset -g POWERLEVEL9K_GOENV_SHOW_SYSTEM=true
  757. # Custom icon.
  758. # typeset -g POWERLEVEL9K_GOENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
  759. ##########[ nodenv: node.js version from nodenv (https://github.com/nodenv/nodenv) ]##########
  760. # Nodenv color.
  761. typeset -g POWERLEVEL9K_NODENV_FOREGROUND=70
  762. # Hide node version if it doesn't come from one of these sources.
  763. typeset -g POWERLEVEL9K_NODENV_SOURCES=(shell local global)
  764. # If set to false, hide node version if it's the same as global:
  765. # $(nodenv version-name) == $(nodenv global).
  766. typeset -g POWERLEVEL9K_NODENV_PROMPT_ALWAYS_SHOW=false
  767. # If set to false, hide node version if it's equal to "system".
  768. typeset -g POWERLEVEL9K_NODENV_SHOW_SYSTEM=true
  769. # Custom icon.
  770. # typeset -g POWERLEVEL9K_NODENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
  771. ##############[ nvm: node.js version from nvm (https://github.com/nvm-sh/nvm) ]###############
  772. # Nvm color.
  773. typeset -g POWERLEVEL9K_NVM_FOREGROUND=70
  774. # Custom icon.
  775. # typeset -g POWERLEVEL9K_NVM_VISUAL_IDENTIFIER_EXPANSION='⭐'
  776. ############[ nodeenv: node.js environment (https://github.com/ekalinin/nodeenv) ]############
  777. # Nodeenv color.
  778. typeset -g POWERLEVEL9K_NODEENV_FOREGROUND=70
  779. # Don't show Node version next to the environment name.
  780. typeset -g POWERLEVEL9K_NODEENV_SHOW_NODE_VERSION=false
  781. # Separate environment name from Node version only with a space.
  782. typeset -g POWERLEVEL9K_NODEENV_{LEFT,RIGHT}_DELIMITER=
  783. # Custom icon.
  784. # typeset -g POWERLEVEL9K_NODEENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
  785. ##############################[ node_version: node.js version ]###############################
  786. # Node version color.
  787. typeset -g POWERLEVEL9K_NODE_VERSION_FOREGROUND=70
  788. # Show node version only when in a directory tree containing package.json.
  789. typeset -g POWERLEVEL9K_NODE_VERSION_PROJECT_ONLY=true
  790. # Custom icon.
  791. # typeset -g POWERLEVEL9K_NODE_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐'
  792. #######################[ go_version: go version (https://golang.org) ]########################
  793. # Go version color.
  794. typeset -g POWERLEVEL9K_GO_VERSION_FOREGROUND=37
  795. # Show go version only when in a go project subdirectory.
  796. typeset -g POWERLEVEL9K_GO_VERSION_PROJECT_ONLY=true
  797. # Custom icon.
  798. # typeset -g POWERLEVEL9K_GO_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐'
  799. #################[ rust_version: rustc version (https://www.rust-lang.org) ]##################
  800. # Rust version color.
  801. typeset -g POWERLEVEL9K_RUST_VERSION_FOREGROUND=37
  802. # Show rust version only when in a rust project subdirectory.
  803. typeset -g POWERLEVEL9K_RUST_VERSION_PROJECT_ONLY=true
  804. # Custom icon.
  805. # typeset -g POWERLEVEL9K_RUST_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐'
  806. ###############[ dotnet_version: .NET version (https://dotnet.microsoft.com) ]################
  807. # .NET version color.
  808. typeset -g POWERLEVEL9K_DOTNET_VERSION_FOREGROUND=134
  809. # Show .NET version only when in a .NET project subdirectory.
  810. typeset -g POWERLEVEL9K_DOTNET_VERSION_PROJECT_ONLY=true
  811. # Custom icon.
  812. # typeset -g POWERLEVEL9K_DOTNET_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐'
  813. #####################[ php_version: php version (https://www.php.net/) ]######################
  814. # PHP version color.
  815. typeset -g POWERLEVEL9K_PHP_VERSION_FOREGROUND=99
  816. # Show PHP version only when in a PHP project subdirectory.
  817. typeset -g POWERLEVEL9K_PHP_VERSION_PROJECT_ONLY=true
  818. # Custom icon.
  819. # typeset -g POWERLEVEL9K_PHP_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐'
  820. ##########[ laravel_version: laravel php framework version (https://laravel.com/) ]###########
  821. # Laravel version color.
  822. typeset -g POWERLEVEL9K_LARAVEL_VERSION_FOREGROUND=161
  823. # Custom icon.
  824. # typeset -g POWERLEVEL9K_LARAVEL_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐'
  825. ####################[ java_version: java version (https://www.java.com/) ]####################
  826. # Java version color.
  827. typeset -g POWERLEVEL9K_JAVA_VERSION_FOREGROUND=32
  828. # Show java version only when in a java project subdirectory.
  829. typeset -g POWERLEVEL9K_JAVA_VERSION_PROJECT_ONLY=true
  830. # Show brief version.
  831. typeset -g POWERLEVEL9K_JAVA_VERSION_FULL=false
  832. # Custom icon.
  833. # typeset -g POWERLEVEL9K_JAVA_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐'
  834. ###[ package: name@version from package.json (https://docs.npmjs.com/files/package.json) ]####
  835. # Package color.
  836. typeset -g POWERLEVEL9K_PACKAGE_FOREGROUND=117
  837. # Package format. The following parameters are available within the expansion.
  838. #
  839. # - P9K_PACKAGE_NAME The value of `name` field in package.json.
  840. # - P9K_PACKAGE_VERSION The value of `version` field in package.json.
  841. #
  842. # typeset -g POWERLEVEL9K_PACKAGE_CONTENT_EXPANSION='${P9K_PACKAGE_NAME//\%/%%}@${P9K_PACKAGE_VERSION//\%/%%}'
  843. # Custom icon.
  844. # typeset -g POWERLEVEL9K_PACKAGE_VISUAL_IDENTIFIER_EXPANSION='⭐'
  845. #############[ rbenv: ruby version from rbenv (https://github.com/rbenv/rbenv) ]##############
  846. # Rbenv color.
  847. typeset -g POWERLEVEL9K_RBENV_FOREGROUND=168
  848. # Hide ruby version if it doesn't come from one of these sources.
  849. typeset -g POWERLEVEL9K_RBENV_SOURCES=(shell local global)
  850. # If set to false, hide ruby version if it's the same as global:
  851. # $(rbenv version-name) == $(rbenv global).
  852. typeset -g POWERLEVEL9K_RBENV_PROMPT_ALWAYS_SHOW=false
  853. # If set to false, hide ruby version if it's equal to "system".
  854. typeset -g POWERLEVEL9K_RBENV_SHOW_SYSTEM=true
  855. # Custom icon.
  856. # typeset -g POWERLEVEL9K_RBENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
  857. #######################[ rvm: ruby version from rvm (https://rvm.io) ]########################
  858. # Rvm color.
  859. typeset -g POWERLEVEL9K_RVM_FOREGROUND=168
  860. # Don't show @gemset at the end.
  861. typeset -g POWERLEVEL9K_RVM_SHOW_GEMSET=false
  862. # Don't show ruby- at the front.
  863. typeset -g POWERLEVEL9K_RVM_SHOW_PREFIX=false
  864. # Custom icon.
  865. # typeset -g POWERLEVEL9K_RVM_VISUAL_IDENTIFIER_EXPANSION='⭐'
  866. ###########[ fvm: flutter version management (https://github.com/leoafarias/fvm) ]############
  867. # Fvm color.
  868. typeset -g POWERLEVEL9K_FVM_FOREGROUND=38
  869. # Custom icon.
  870. # typeset -g POWERLEVEL9K_FVM_VISUAL_IDENTIFIER_EXPANSION='⭐'
  871. ##########[ luaenv: lua version from luaenv (https://github.com/cehoffman/luaenv) ]###########
  872. # Lua color.
  873. typeset -g POWERLEVEL9K_LUAENV_FOREGROUND=32
  874. # Hide lua version if it doesn't come from one of these sources.
  875. typeset -g POWERLEVEL9K_LUAENV_SOURCES=(shell local global)
  876. # If set to false, hide lua version if it's the same as global:
  877. # $(luaenv version-name) == $(luaenv global).
  878. typeset -g POWERLEVEL9K_LUAENV_PROMPT_ALWAYS_SHOW=false
  879. # If set to false, hide lua version if it's equal to "system".
  880. typeset -g POWERLEVEL9K_LUAENV_SHOW_SYSTEM=true
  881. # Custom icon.
  882. # typeset -g POWERLEVEL9K_LUAENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
  883. ###############[ jenv: java version from jenv (https://github.com/jenv/jenv) ]################
  884. # Java color.
  885. typeset -g POWERLEVEL9K_JENV_FOREGROUND=32
  886. # Hide java version if it doesn't come from one of these sources.
  887. typeset -g POWERLEVEL9K_JENV_SOURCES=(shell local global)
  888. # If set to false, hide java version if it's the same as global:
  889. # $(jenv version-name) == $(jenv global).
  890. typeset -g POWERLEVEL9K_JENV_PROMPT_ALWAYS_SHOW=false
  891. # If set to false, hide java version if it's equal to "system".
  892. typeset -g POWERLEVEL9K_JENV_SHOW_SYSTEM=true
  893. # Custom icon.
  894. # typeset -g POWERLEVEL9K_JENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
  895. ###########[ plenv: perl version from plenv (https://github.com/tokuhirom/plenv) ]############
  896. # Perl color.
  897. typeset -g POWERLEVEL9K_PLENV_FOREGROUND=67
  898. # Hide perl version if it doesn't come from one of these sources.
  899. typeset -g POWERLEVEL9K_PLENV_SOURCES=(shell local global)
  900. # If set to false, hide perl version if it's the same as global:
  901. # $(plenv version-name) == $(plenv global).
  902. typeset -g POWERLEVEL9K_PLENV_PROMPT_ALWAYS_SHOW=false
  903. # If set to false, hide perl version if it's equal to "system".
  904. typeset -g POWERLEVEL9K_PLENV_SHOW_SYSTEM=true
  905. # Custom icon.
  906. # typeset -g POWERLEVEL9K_PLENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
  907. ############[ phpenv: php version from phpenv (https://github.com/phpenv/phpenv) ]############
  908. # PHP color.
  909. typeset -g POWERLEVEL9K_PHPENV_FOREGROUND=99
  910. # Hide php version if it doesn't come from one of these sources.
  911. typeset -g POWERLEVEL9K_PHPENV_SOURCES=(shell local global)
  912. # If set to false, hide php version if it's the same as global:
  913. # $(phpenv version-name) == $(phpenv global).
  914. typeset -g POWERLEVEL9K_PHPENV_PROMPT_ALWAYS_SHOW=false
  915. # If set to false, hide php version if it's equal to "system".
  916. typeset -g POWERLEVEL9K_PHPENV_SHOW_SYSTEM=true
  917. # Custom icon.
  918. # typeset -g POWERLEVEL9K_PHPENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
  919. ##########[ haskell_stack: haskell version from stack (https://haskellstack.org/) ]###########
  920. # Haskell color.
  921. typeset -g POWERLEVEL9K_HASKELL_STACK_FOREGROUND=172
  922. # Hide haskell version if it doesn't come from one of these sources.
  923. #
  924. # shell: version is set by STACK_YAML
  925. # local: version is set by stack.yaml up the directory tree
  926. # global: version is set by the implicit global project (~/.stack/global-project/stack.yaml)
  927. typeset -g POWERLEVEL9K_HASKELL_STACK_SOURCES=(shell local)
  928. # If set to false, hide haskell version if it's the same as in the implicit global project.
  929. typeset -g POWERLEVEL9K_HASKELL_STACK_ALWAYS_SHOW=true
  930. # Custom icon.
  931. # typeset -g POWERLEVEL9K_HASKELL_STACK_VISUAL_IDENTIFIER_EXPANSION='⭐'
  932. #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]#############
  933. # Show kubecontext only when the the command you are typing invokes one of these tools.
  934. # Tip: Remove the next line to always show kubecontext.
  935. typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito'
  936. # Kubernetes context classes for the purpose of using different colors, icons and expansions with
  937. # different contexts.
  938. #
  939. # POWERLEVEL9K_KUBECONTEXT_CLASSES is an array with even number of elements. The first element
  940. # in each pair defines a pattern against which the current kubernetes context gets matched.
  941. # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below)
  942. # that gets matched. If you unset all POWERLEVEL9K_KUBECONTEXT_*CONTENT_EXPANSION parameters,
  943. # you'll see this value in your prompt. The second element of each pair in
  944. # POWERLEVEL9K_KUBECONTEXT_CLASSES defines the context class. Patterns are tried in order. The
  945. # first match wins.
  946. #
  947. # For example, given these settings:
  948. #
  949. # typeset -g POWERLEVEL9K_KUBECONTEXT_CLASSES=(
  950. # '*prod*' PROD
  951. # '*test*' TEST
  952. # '*' DEFAULT)
  953. #
  954. # If your current kubernetes context is "deathray-testing/default", its class is TEST
  955. # because "deathray-testing/default" doesn't match the pattern '*prod*' but does match '*test*'.
  956. #
  957. # You can define different colors, icons and content expansions for different classes:
  958. #
  959. # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_FOREGROUND=28
  960. # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐'
  961. # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <'
  962. typeset -g POWERLEVEL9K_KUBECONTEXT_CLASSES=(
  963. # '*prod*' PROD # These values are examples that are unlikely
  964. # '*test*' TEST # to match your needs. Customize them as needed.
  965. '*' DEFAULT)
  966. typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_FOREGROUND=134
  967. typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='○'
  968. # Use POWERLEVEL9K_KUBECONTEXT_CONTENT_EXPANSION to specify the content displayed by kubecontext
  969. # segment. Parameter expansions are very flexible and fast, too. See reference:
  970. # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion.
  971. #
  972. # Within the expansion the following parameters are always available:
  973. #
  974. # - P9K_CONTENT The content that would've been displayed if there was no content
  975. # expansion defined.
  976. # - P9K_KUBECONTEXT_NAME The current context's name. Corresponds to column NAME in the
  977. # output of `kubectl config get-contexts`.
  978. # - P9K_KUBECONTEXT_CLUSTER The current context's cluster. Corresponds to column CLUSTER in the
  979. # output of `kubectl config get-contexts`.
  980. # - P9K_KUBECONTEXT_NAMESPACE The current context's namespace. Corresponds to column NAMESPACE
  981. # in the output of `kubectl config get-contexts`. If there is no
  982. # namespace, the parameter is set to "default".
  983. # - P9K_KUBECONTEXT_USER The current context's user. Corresponds to column AUTHINFO in the
  984. # output of `kubectl config get-contexts`.
  985. #
  986. # If the context points to Google Kubernetes Engine (GKE) or Elastic Kubernetes Service (EKS),
  987. # the following extra parameters are available:
  988. #
  989. # - P9K_KUBECONTEXT_CLOUD_NAME Either "gke" or "eks".
  990. # - P9K_KUBECONTEXT_CLOUD_ACCOUNT Account/project ID.
  991. # - P9K_KUBECONTEXT_CLOUD_ZONE Availability zone.
  992. # - P9K_KUBECONTEXT_CLOUD_CLUSTER Cluster.
  993. #
  994. # P9K_KUBECONTEXT_CLOUD_* parameters are derived from P9K_KUBECONTEXT_CLUSTER. For example,
  995. # if P9K_KUBECONTEXT_CLUSTER is "gke_my-account_us-east1-a_my-cluster-01":
  996. #
  997. # - P9K_KUBECONTEXT_CLOUD_NAME=gke
  998. # - P9K_KUBECONTEXT_CLOUD_ACCOUNT=my-account
  999. # - P9K_KUBECONTEXT_CLOUD_ZONE=us-east1-a
  1000. # - P9K_KUBECONTEXT_CLOUD_CLUSTER=my-cluster-01
  1001. #
  1002. # If P9K_KUBECONTEXT_CLUSTER is "arn:aws:eks:us-east-1:123456789012:cluster/my-cluster-01":
  1003. #
  1004. # - P9K_KUBECONTEXT_CLOUD_NAME=eks
  1005. # - P9K_KUBECONTEXT_CLOUD_ACCOUNT=123456789012
  1006. # - P9K_KUBECONTEXT_CLOUD_ZONE=us-east-1
  1007. # - P9K_KUBECONTEXT_CLOUD_CLUSTER=my-cluster-01
  1008. typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION=
  1009. # Show P9K_KUBECONTEXT_CLOUD_CLUSTER if it's not empty and fall back to P9K_KUBECONTEXT_NAME.
  1010. POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION+='${P9K_KUBECONTEXT_CLOUD_CLUSTER:-${P9K_KUBECONTEXT_NAME}}'
  1011. # Append the current context's namespace if it's not "default".
  1012. POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION+='${${:-/$P9K_KUBECONTEXT_NAMESPACE}:#/default}'
  1013. # Custom prefix.
  1014. # typeset -g POWERLEVEL9K_KUBECONTEXT_PREFIX='%fat '
  1015. ################[ terraform: terraform workspace (https://www.terraform.io) ]#################
  1016. # POWERLEVEL9K_TERRAFORM_CLASSES is an array with even number of elements. The first element
  1017. # in each pair defines a pattern against which the current terraform workspace gets matched.
  1018. # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below)
  1019. # that gets matched. If you unset all POWERLEVEL9K_TERRAFORM_*CONTENT_EXPANSION parameters,
  1020. # you'll see this value in your prompt. The second element of each pair in
  1021. # POWERLEVEL9K_TERRAFORM_CLASSES defines the workspace class. Patterns are tried in order. The
  1022. # first match wins.
  1023. #
  1024. # For example, given these settings:
  1025. #
  1026. # typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=(
  1027. # '*prod*' PROD
  1028. # '*test*' TEST
  1029. # '*' DEFAULT)
  1030. #
  1031. # If your current terraform workspace is "project_test", its class is TEST because "project_test"
  1032. # doesn't match the pattern '*prod*' but does match '*test*'.
  1033. #
  1034. # You can define different colors, icons and content expansions for different classes:
  1035. #
  1036. # typeset -g POWERLEVEL9K_TERRAFORM_TEST_FOREGROUND=28
  1037. # typeset -g POWERLEVEL9K_TERRAFORM_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐'
  1038. # typeset -g POWERLEVEL9K_TERRAFORM_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <'
  1039. typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=(
  1040. # '*prod*' PROD # These values are examples that are unlikely
  1041. # '*test*' TEST # to match your needs. Customize them as needed.
  1042. '*' DEFAULT)
  1043. typeset -g POWERLEVEL9K_TERRAFORM_DEFAULT_FOREGROUND=38
  1044. # typeset -g POWERLEVEL9K_TERRAFORM_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐'
  1045. #[ aws: aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) ]#
  1046. # Show aws only when the the command you are typing invokes one of these tools.
  1047. # Tip: Remove the next line to always show aws.
  1048. typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|terraform|pulumi'
  1049. # POWERLEVEL9K_AWS_CLASSES is an array with even number of elements. The first element
  1050. # in each pair defines a pattern against which the current AWS profile gets matched.
  1051. # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below)
  1052. # that gets matched. If you unset all POWERLEVEL9K_AWS_*CONTENT_EXPANSION parameters,
  1053. # you'll see this value in your prompt. The second element of each pair in
  1054. # POWERLEVEL9K_AWS_CLASSES defines the profile class. Patterns are tried in order. The
  1055. # first match wins.
  1056. #
  1057. # For example, given these settings:
  1058. #
  1059. # typeset -g POWERLEVEL9K_AWS_CLASSES=(
  1060. # '*prod*' PROD
  1061. # '*test*' TEST
  1062. # '*' DEFAULT)
  1063. #
  1064. # If your current AWS profile is "company_test", its class is TEST
  1065. # because "company_test" doesn't match the pattern '*prod*' but does match '*test*'.
  1066. #
  1067. # You can define different colors, icons and content expansions for different classes:
  1068. #
  1069. # typeset -g POWERLEVEL9K_AWS_TEST_FOREGROUND=28
  1070. # typeset -g POWERLEVEL9K_AWS_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐'
  1071. # typeset -g POWERLEVEL9K_AWS_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <'
  1072. typeset -g POWERLEVEL9K_AWS_CLASSES=(
  1073. # '*prod*' PROD # These values are examples that are unlikely
  1074. # '*test*' TEST # to match your needs. Customize them as needed.
  1075. '*' DEFAULT)
  1076. typeset -g POWERLEVEL9K_AWS_DEFAULT_FOREGROUND=208
  1077. # typeset -g POWERLEVEL9K_AWS_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐'
  1078. #[ aws_eb_env: aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) ]#
  1079. # AWS Elastic Beanstalk environment color.
  1080. typeset -g POWERLEVEL9K_AWS_EB_ENV_FOREGROUND=70
  1081. # Custom icon.
  1082. typeset -g POWERLEVEL9K_AWS_EB_ENV_VISUAL_IDENTIFIER_EXPANSION='eb'
  1083. ##########[ azure: azure account name (https://docs.microsoft.com/en-us/cli/azure) ]##########
  1084. # Show azure only when the the command you are typing invokes one of these tools.
  1085. # Tip: Remove the next line to always show azure.
  1086. typeset -g POWERLEVEL9K_AZURE_SHOW_ON_COMMAND='az|terraform|pulumi'
  1087. # Azure account name color.
  1088. typeset -g POWERLEVEL9K_AZURE_FOREGROUND=32
  1089. # Custom icon.
  1090. typeset -g POWERLEVEL9K_AZURE_VISUAL_IDENTIFIER_EXPANSION='az'
  1091. ##########[ gcloud: google cloud account and project (https://cloud.google.com/) ]###########
  1092. # Show gcloud only when the the command you are typing invokes one of these tools.
  1093. # Tip: Remove the next line to always show gcloud.
  1094. typeset -g POWERLEVEL9K_GCLOUD_SHOW_ON_COMMAND='gcloud|gcs'
  1095. # Google cloud color.
  1096. typeset -g POWERLEVEL9K_GCLOUD_FOREGROUND=32
  1097. # Google cloud format. Change the value of POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION and/or
  1098. # POWERLEVEL9K_GCLOUD_COMPLETE_CONTENT_EXPANSION if the default is too verbose or not informative
  1099. # enough. You can use the following parameters in the expansions. Each of them corresponds to the
  1100. # output of `gcloud` tool.
  1101. #
  1102. # Parameter | Source
  1103. # -------------------------|--------------------------------------------------------------------
  1104. # P9K_GCLOUD_CONFIGURATION | gcloud config configurations list --format='value(name)'
  1105. # P9K_GCLOUD_ACCOUNT | gcloud config get-value account
  1106. # P9K_GCLOUD_PROJECT_ID | gcloud config get-value project
  1107. # P9K_GCLOUD_PROJECT_NAME | gcloud projects describe $P9K_GCLOUD_PROJECT_ID --format='value(name)'
  1108. #
  1109. # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurences of '%' replaced with '%%'.
  1110. #
  1111. # Obtaining project name requires sending a request to Google servers. This can take a long time
  1112. # and even fail. When project name is unknown, P9K_GCLOUD_PROJECT_NAME is not set and gcloud
  1113. # prompt segment is in state PARTIAL. When project name gets known, P9K_GCLOUD_PROJECT_NAME gets
  1114. # set and gcloud prompt segment transitions to state COMPLETE.
  1115. #
  1116. # You can customize the format, icon and colors of gcloud segment separately for states PARTIAL
  1117. # and COMPLETE. You can also hide gcloud in state PARTIAL by setting
  1118. # POWERLEVEL9K_GCLOUD_PARTIAL_VISUAL_IDENTIFIER_EXPANSION and
  1119. # POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION to empty.
  1120. typeset -g POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION='${P9K_GCLOUD_PROJECT_ID//\%/%%}'
  1121. typeset -g POWERLEVEL9K_GCLOUD_COMPLETE_CONTENT_EXPANSION='${P9K_GCLOUD_PROJECT_NAME//\%/%%}'
  1122. # Send a request to Google (by means of `gcloud projects describe ...`) to obtain project name
  1123. # this often. Negative value disables periodic polling. In this mode project name is retrieved
  1124. # only when the current configuration, account or project id changes.
  1125. typeset -g POWERLEVEL9K_GCLOUD_REFRESH_PROJECT_NAME_SECONDS=60
  1126. # Custom icon.
  1127. # typeset -g POWERLEVEL9K_GCLOUD_VISUAL_IDENTIFIER_EXPANSION='⭐'
  1128. #[ google_app_cred: google application credentials (https://cloud.google.com/docs/authentication/production) ]#
  1129. # Show google_app_cred only when the the command you are typing invokes one of these tools.
  1130. # Tip: Remove the next line to always show google_app_cred.
  1131. typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_SHOW_ON_COMMAND='terraform|pulumi'
  1132. # Google application credentials classes for the purpose of using different colors, icons and
  1133. # expansions with different credentials.
  1134. #
  1135. # POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES is an array with even number of elements. The first
  1136. # element in each pair defines a pattern against which the current kubernetes context gets
  1137. # matched. More specifically, it's P9K_CONTENT prior to the application of context expansion
  1138. # (see below) that gets matched. If you unset all POWERLEVEL9K_GOOGLE_APP_CRED_*CONTENT_EXPANSION
  1139. # parameters, you'll see this value in your prompt. The second element of each pair in
  1140. # POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES defines the context class. Patterns are tried in order.
  1141. # The first match wins.
  1142. #
  1143. # For example, given these settings:
  1144. #
  1145. # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES=(
  1146. # '*:*prod*:*' PROD
  1147. # '*:*test*:*' TEST
  1148. # '*' DEFAULT)
  1149. #
  1150. # If your current Google application credentials is "service_account deathray-testing x@y.com",
  1151. # its class is TEST because it doesn't match the pattern '* *prod* *' but does match '* *test* *'.
  1152. #
  1153. # You can define different colors, icons and content expansions for different classes:
  1154. #
  1155. # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_FOREGROUND=28
  1156. # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐'
  1157. # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_CONTENT_EXPANSION='$P9K_GOOGLE_APP_CRED_PROJECT_ID'
  1158. typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES=(
  1159. # '*:*prod*:*' PROD # These values are examples that are unlikely
  1160. # '*:*test*:*' TEST # to match your needs. Customize them as needed.
  1161. '*' DEFAULT)
  1162. typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_FOREGROUND=32
  1163. # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐'
  1164. # Use POWERLEVEL9K_GOOGLE_APP_CRED_CONTENT_EXPANSION to specify the content displayed by
  1165. # google_app_cred segment. Parameter expansions are very flexible and fast, too. See reference:
  1166. # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion.
  1167. #
  1168. # You can use the following parameters in the expansion. Each of them corresponds to one of the
  1169. # fields in the JSON file pointed to by GOOGLE_APPLICATION_CREDENTIALS.
  1170. #
  1171. # Parameter | JSON key file field
  1172. # ---------------------------------+---------------
  1173. # P9K_GOOGLE_APP_CRED_TYPE | type
  1174. # P9K_GOOGLE_APP_CRED_PROJECT_ID | project_id
  1175. # P9K_GOOGLE_APP_CRED_CLIENT_EMAIL | client_email
  1176. #
  1177. # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurences of '%' replaced by '%%'.
  1178. typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_CONTENT_EXPANSION='${P9K_GOOGLE_APP_CRED_PROJECT_ID//\%/%%}'
  1179. ###############################[ public_ip: public IP address ]###############################
  1180. # Public IP color.
  1181. typeset -g POWERLEVEL9K_PUBLIC_IP_FOREGROUND=94
  1182. # Custom icon.
  1183. # typeset -g POWERLEVEL9K_PUBLIC_IP_VISUAL_IDENTIFIER_EXPANSION='⭐'
  1184. ########################[ vpn_ip: virtual private network indicator ]#########################
  1185. # VPN IP color.
  1186. typeset -g POWERLEVEL9K_VPN_IP_FOREGROUND=81
  1187. # When on VPN, show just an icon without the IP address.
  1188. # Tip: To display the private IP address when on VPN, remove the next line.
  1189. typeset -g POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION=
  1190. # Regular expression for the VPN network interface. Run `ifconfig` or `ip -4 a show` while on VPN
  1191. # to see the name of the interface.
  1192. typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(wg|(.*tun))[0-9]*'
  1193. # If set to true, show one segment per matching network interface. If set to false, show only
  1194. # one segment corresponding to the first matching network interface.
  1195. # Tip: If you set it to true, you'll probably want to unset POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION.
  1196. typeset -g POWERLEVEL9K_VPN_IP_SHOW_ALL=false
  1197. # Custom icon.
  1198. # typeset -g POWERLEVEL9K_VPN_IP_VISUAL_IDENTIFIER_EXPANSION='⭐'
  1199. ###########[ ip: ip address and bandwidth usage for a specified network interface ]###########
  1200. # IP color.
  1201. typeset -g POWERLEVEL9K_IP_FOREGROUND=38
  1202. # The following parameters are accessible within the expansion:
  1203. #
  1204. # Parameter | Meaning
  1205. # ----------------------+---------------
  1206. # P9K_IP_IP | IP address
  1207. # P9K_IP_INTERFACE | network interface
  1208. # P9K_IP_RX_BYTES | total number of bytes received
  1209. # P9K_IP_TX_BYTES | total number of bytes sent
  1210. # P9K_IP_RX_RATE | receive rate (since last prompt)
  1211. # P9K_IP_TX_RATE | send rate (since last prompt)
  1212. typeset -g POWERLEVEL9K_IP_CONTENT_EXPANSION='$P9K_IP_IP${P9K_IP_RX_RATE:+ %70F⇣$P9K_IP_RX_RATE}${P9K_IP_TX_RATE:+ %215F⇡$P9K_IP_TX_RATE}'
  1213. # Show information for the first network interface whose name matches this regular expression.
  1214. # Run `ifconfig` or `ip -4 a show` to see the names of all network interfaces.
  1215. typeset -g POWERLEVEL9K_IP_INTERFACE='e.*'
  1216. # Custom icon.
  1217. # typeset -g POWERLEVEL9K_IP_VISUAL_IDENTIFIER_EXPANSION='⭐'
  1218. #########################[ proxy: system-wide http/https/ftp proxy ]##########################
  1219. # Proxy color.
  1220. typeset -g POWERLEVEL9K_PROXY_FOREGROUND=68
  1221. # Custom icon.
  1222. # typeset -g POWERLEVEL9K_PROXY_VISUAL_IDENTIFIER_EXPANSION='⭐'
  1223. ################################[ battery: internal battery ]#################################
  1224. # Show battery in red when it's below this level and not connected to power supply.
  1225. typeset -g POWERLEVEL9K_BATTERY_LOW_THRESHOLD=20
  1226. typeset -g POWERLEVEL9K_BATTERY_LOW_FOREGROUND=160
  1227. # Show battery in green when it's charging or fully charged.
  1228. typeset -g POWERLEVEL9K_BATTERY_{CHARGING,CHARGED}_FOREGROUND=70
  1229. # Show battery in yellow when it's discharging.
  1230. typeset -g POWERLEVEL9K_BATTERY_DISCONNECTED_FOREGROUND=178
  1231. # Battery pictograms going from low to high level of charge.
  1232. typeset -g POWERLEVEL9K_BATTERY_STAGES=('%K{232}▁' '%K{232}▂' '%K{232}▃' '%K{232}▄' '%K{232}▅' '%K{232}▆' '%K{232}▇' '%K{232}█')
  1233. # Don't show the remaining time to charge/discharge.
  1234. typeset -g POWERLEVEL9K_BATTERY_VERBOSE=false
  1235. #####################################[ wifi: wifi speed ]#####################################
  1236. # WiFi color.
  1237. typeset -g POWERLEVEL9K_WIFI_FOREGROUND=68
  1238. # Custom icon.
  1239. # typeset -g POWERLEVEL9K_WIFI_VISUAL_IDENTIFIER_EXPANSION='⭐'
  1240. # Use different colors and icons depending on signal strength ($P9K_WIFI_BARS).
  1241. #
  1242. # # Wifi colors and icons for different signal strength levels (low to high).
  1243. # typeset -g my_wifi_fg=(68 68 68 68 68) # <-- change these values
  1244. # typeset -g my_wifi_icon=('WiFi' 'WiFi' 'WiFi' 'WiFi' 'WiFi') # <-- change these values
  1245. #
  1246. # typeset -g POWERLEVEL9K_WIFI_CONTENT_EXPANSION='%F{${my_wifi_fg[P9K_WIFI_BARS+1]}}$P9K_WIFI_LAST_TX_RATE Mbps'
  1247. # typeset -g POWERLEVEL9K_WIFI_VISUAL_IDENTIFIER_EXPANSION='%F{${my_wifi_fg[P9K_WIFI_BARS+1]}}${my_wifi_icon[P9K_WIFI_BARS+1]}'
  1248. #
  1249. # The following parameters are accessible within the expansions:
  1250. #
  1251. # Parameter | Meaning
  1252. # ----------------------+---------------
  1253. # P9K_WIFI_SSID | service set identifier, a.k.a. network name
  1254. # P9K_WIFI_LINK_AUTH | authentication protocol such as "wpa2-psk" or "none"
  1255. # P9K_WIFI_LAST_TX_RATE | wireless transmit rate in megabits per second
  1256. # P9K_WIFI_RSSI | signal strength in dBm, from -120 to 0
  1257. # P9K_WIFI_NOISE | noise in dBm, from -120 to 0
  1258. # P9K_WIFI_BARS | signal strength in bars, from 0 to 4 (derived from P9K_WIFI_RSSI and P9K_WIFI_NOISE)
  1259. #
  1260. # All parameters except P9K_WIFI_BARS are extracted from the output of the following command:
  1261. #
  1262. # /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I
  1263. ####################################[ time: current time ]####################################
  1264. # Current time color.
  1265. typeset -g POWERLEVEL9K_TIME_FOREGROUND=66
  1266. # Format for the current time: 09:51:02. See `man 3 strftime`.
  1267. typeset -g POWERLEVEL9K_TIME_FORMAT='%D{%H:%M:%S}'
  1268. # If set to true, time will update when you hit enter. This way prompts for the past
  1269. # commands will contain the start times of their commands as opposed to the default
  1270. # behavior where they contain the end times of their preceding commands.
  1271. typeset -g POWERLEVEL9K_TIME_UPDATE_ON_COMMAND=false
  1272. # Custom icon.
  1273. typeset -g POWERLEVEL9K_TIME_VISUAL_IDENTIFIER_EXPANSION=
  1274. # Custom prefix.
  1275. # typeset -g POWERLEVEL9K_TIME_PREFIX='%fat '
  1276. # Example of a user-defined prompt segment. Function prompt_example will be called on every
  1277. # prompt if `example` prompt segment is added to POWERLEVEL9K_LEFT_PROMPT_ELEMENTS or
  1278. # POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS. It displays an icon and orange text greeting the user.
  1279. #
  1280. # Type `p10k help segment` for documentation and a more sophisticated example.
  1281. function prompt_example() {
  1282. p10k segment -f 208 -i '⭐' -t 'hello, %n'
  1283. }
  1284. # User-defined prompt segments may optionally provide an instant_prompt_* function. Its job
  1285. # is to generate the prompt segment for display in instant prompt. See
  1286. # https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt.
  1287. #
  1288. # Powerlevel10k will call instant_prompt_* at the same time as the regular prompt_* function
  1289. # and will record all `p10k segment` calls it makes. When displaying instant prompt, Powerlevel10k
  1290. # will replay these calls without actually calling instant_prompt_*. It is imperative that
  1291. # instant_prompt_* always makes the same `p10k segment` calls regardless of environment. If this
  1292. # rule is not observed, the content of instant prompt will be incorrect.
  1293. #
  1294. # Usually, you should either not define instant_prompt_* or simply call prompt_* from it. If
  1295. # instant_prompt_* is not defined for a segment, the segment won't be shown in instant prompt.
  1296. function instant_prompt_example() {
  1297. # Since prompt_example always makes the same `p10k segment` calls, we can call it from
  1298. # instant_prompt_example. This will give us the same `example` prompt segment in the instant
  1299. # and regular prompts.
  1300. prompt_example
  1301. }
  1302. # User-defined prompt segments can be customized the same way as built-in segments.
  1303. # typeset -g POWERLEVEL9K_EXAMPLE_FOREGROUND=208
  1304. # typeset -g POWERLEVEL9K_EXAMPLE_VISUAL_IDENTIFIER_EXPANSION='⭐'
  1305. # Transient prompt works similarly to the builtin transient_rprompt option. It trims down prompt
  1306. # when accepting a command line. Supported values:
  1307. #
  1308. # - off: Don't change prompt when accepting a command line.
  1309. # - always: Trim down prompt when accepting a command line.
  1310. # - same-dir: Trim down prompt when accepting a command line unless this is the first command
  1311. # typed after changing current working directory.
  1312. typeset -g POWERLEVEL9K_TRANSIENT_PROMPT=always
  1313. # Instant prompt mode.
  1314. #
  1315. # - off: Disable instant prompt. Choose this if you've tried instant prompt and found
  1316. # it incompatible with your zsh configuration files.
  1317. # - quiet: Enable instant prompt and don't print warnings when detecting console output
  1318. # during zsh initialization. Choose this if you've read and understood
  1319. # https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt.
  1320. # - verbose: Enable instant prompt and print a warning when detecting console output during
  1321. # zsh initialization. Choose this if you've never tried instant prompt, haven't
  1322. # seen the warning, or if you are unsure what this all means.
  1323. typeset -g POWERLEVEL9K_INSTANT_PROMPT=verbose
  1324. # Hot reload allows you to change POWERLEVEL9K options after Powerlevel10k has been initialized.
  1325. # For example, you can type POWERLEVEL9K_BACKGROUND=red and see your prompt turn red. Hot reload
  1326. # can slow down prompt by 1-2 milliseconds, so it's better to keep it turned off unless you
  1327. # really need it.
  1328. typeset -g POWERLEVEL9K_DISABLE_HOT_RELOAD=true
  1329. # If p10k is already loaded, reload configuration.
  1330. # This works even with POWERLEVEL9K_DISABLE_HOT_RELOAD=true.
  1331. (( ! $+functions[p10k] )) || p10k reload
  1332. }
  1333. (( ${#p10k_config_opts} )) && setopt ${p10k_config_opts[@]}
  1334. 'builtin' 'unset' 'p10k_config_opts'