home

My NixOS systems configurations.
Log | Files | Refs | LICENSE

prompt.zsh (45845B)


      1 # Config for Powerlevel10k with lean prompt style. Type `p10k configure` to generate
      2 # your own config based on it.
      3 #
      4 # Tip: Looking for a nice color? Here's a one-liner to print colormap.
      5 #
      6 #   for i in {0..255}; do print -Pn "%${i}F${(l:3::0:)i}%f " ${${(M)$((i%8)):#7}:+$'\n'}; done
      7 
      8 # Temporarily change options.
      9 'builtin' 'local' '-a' 'p10k_config_opts'
     10 [[ ! -o 'aliases'         ]] || p10k_config_opts+=('aliases')
     11 [[ ! -o 'sh_glob'         ]] || p10k_config_opts+=('sh_glob')
     12 [[ ! -o 'no_brace_expand' ]] || p10k_config_opts+=('no_brace_expand')
     13 'builtin' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand'
     14 
     15 () {
     16   emulate -L zsh
     17   setopt no_unset extended_glob
     18   zmodload zsh/langinfo
     19   if [[ ${langinfo[CODESET]:-} != (utf|UTF)(-|)8 ]]; then
     20     local LC_ALL=${${(@M)$(locale -a):#*.(utf|UTF)(-|)8}[1]:-en_US.UTF-8}
     21   fi
     22 
     23   # Unset all configuration options. This allows you to apply configiguration changes without
     24   # restarting zsh. Edit ~/.p10k.zsh and type `source ~/.p10k.zsh`.
     25   unset -m 'POWERLEVEL9K_*'
     26 
     27   # The list of segments shown on the left. Fill it with the most important segments.
     28   typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(
     29       # =========================[ Line #1 ]=========================
     30       # os_icon               # os identifier
     31       dir                     # current directory
     32       vcs                     # git status
     33       prompt_char             # prompt symbol
     34   )
     35 
     36   # The list of segments shown on the right. Fill it with less important segments.
     37   # Right prompt on the last prompt line (where you are typing your commands) gets
     38   # automatically hidden when the input line reaches it. Right prompt above the
     39   # last prompt line gets hidden if it would overlap with left prompt.
     40   typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(
     41       # =========================[ Line #1 ]=========================
     42       status                  # exit code of the last command
     43       command_execution_time  # duration of the last command
     44       background_jobs         # presence of background jobs
     45       direnv                  # direnv status (https://direnv.net/)
     46       virtualenv              # python virtual environment (https://docs.python.org/3/library/venv.html)
     47       #anaconda                # conda environment (https://conda.io/)
     48       pyenv                   # python environment (https://github.com/pyenv/pyenv)
     49       #nodenv                  # node.js version from nodenv (https://github.com/nodenv/nodenv)
     50       #nvm                     # node.js version from nvm (https://github.com/nvm-sh/nvm)
     51       #nodeenv                 # node.js environment (https://github.com/ekalinin/nodeenv)
     52       # node_version          # node.js version
     53       go_version            # go version (https://golang.org)
     54       rust_version          # rustc version (https://www.rust-lang.org)
     55       # dotnet_version        # .NET version (https://dotnet.microsoft.com)
     56       #rbenv                   # ruby version from rbenv (https://github.com/rbenv/rbenv)
     57       #rvm                     # ruby version from rvm (https://rvm.io)
     58       kubecontext             # current kubernetes context (https://kubernetes.io/)
     59       terraform               # terraform workspace (https://www.terraform.io)
     60       #aws                     # aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html)
     61       # aws_eb_env            # aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/)
     62       # azure                 # azure account name (https://docs.microsoft.com/en-us/cli/azure)
     63       context                 # user@hostname
     64       #nordvpn                 # nordvpn connection status, linux only (https://nordvpn.com/)
     65       #ranger                  # ranger shell (https://github.com/ranger/ranger)
     66       # vpn_ip                # virtual private network indicator
     67       # ram                   # free RAM
     68       # load                  # CPU load
     69       in_nix_shell
     70       docker_host
     71       time                    # current time
     72       # =========================[ Line #2 ]=========================
     73       #newline
     74       # public_ip             # public IP address
     75       # proxy                 # system-wide http/https/ftp proxy
     76       #battery                # internal battery
     77       # example               # example user-defined segment (see prompt_example function below)
     78   )
     79 
     80   # Basic style options that define the overall look of your prompt. You probably don't want to
     81   # change them.
     82   typeset -g POWERLEVEL9K_BACKGROUND=                            # transparent background
     83   typeset -g POWERLEVEL9K_{LEFT,RIGHT}_{LEFT,RIGHT}_WHITESPACE=  # no surrounding whitespace
     84   typeset -g POWERLEVEL9K_{LEFT,RIGHT}_SUBSEGMENT_SEPARATOR=' '  # separate segments with a space
     85   typeset -g POWERLEVEL9K_{LEFT,RIGHT}_SEGMENT_SEPARATOR=        # no end-of-line symbol
     86 
     87   # To disable default icons for all segments, set POWERLEVEL9K_VISUAL_IDENTIFIER_EXPANSION=''.
     88   #
     89   # To enable default icons for all segments, don't define POWERLEVEL9K_VISUAL_IDENTIFIER_EXPANSION
     90   # or set it to '${P9K_VISUAL_IDENTIFIER}'.
     91   #
     92   # To remove spaces from all default icons, set POWERLEVEL9K_VISUAL_IDENTIFIER_EXPANSION
     93   # to '${P9K_VISUAL_IDENTIFIER// }'. You'll know that you you need this option if you see extra
     94   # spaces after icons.
     95   #
     96   # To enable default icons for one segment (e.g., dir), set
     97   # POWERLEVEL9K_DIR_VISUAL_IDENTIFIER_EXPANSION='${P9K_VISUAL_IDENTIFIER}'.
     98   #
     99   # To assign a specific icon to one segment (e.g., dir), set
    100   # POWERLEVEL9K_DIR_VISUAL_IDENTIFIER_EXPANSION='⭐'.
    101   #
    102   # To assign a specific icon to a segment in a given state (e.g., dir in state NOT_WRITABLE),
    103   # set POWERLEVEL9K_DIR_NOT_WRITABLE_VISUAL_IDENTIFIER_EXPANSION='⭐'.
    104   #
    105   # Note: You can use $'\u2B50' instead of '⭐'. It's especially convenient when specifying
    106   # icons that your text editor cannot render. Don't forget to put $ and use single quotes when
    107   # defining icons via Unicode codepoints.
    108   #
    109   # Note: Many default icons cannot be displayed with system fonts. You'll need to install a
    110   # capable font to use them. See POWERLEVEL9K_MODE below.
    111   typeset -g POWERLEVEL9K_VISUAL_IDENTIFIER_EXPANSION=
    112 
    113   # This option makes a difference only when default icons are enabled for all or some prompt
    114   # segments (see POWERLEVEL9K_VISUAL_IDENTIFIER_EXPANSION above). LOCK_ICON can be printed as
    115   # $'\uE0A2', $'\uE138' or $'\uF023' depending on POWERLEVEL9K_MODE. The correct value of this
    116   # parameter depends on the provider of the font your terminal is using.
    117   #
    118   #   Font Provider                    | POWERLEVEL9K_MODE
    119   #   ---------------------------------+-------------------
    120   #   Powerline                        | powerline
    121   #   Font Awesome                     | awesome-fontconfig
    122   #   Adobe Source Code Pro            | awesome-fontconfig
    123   #   Source Code Pro                  | awesome-fontconfig
    124   #   Awesome-Terminal Fonts (regular) | awesome-fontconfig
    125   #   Awesome-Terminal Fonts (patched) | awesome-patched
    126   #   Nerd Fonts                       | nerdfont-complete
    127   #   Other                            | compatible
    128   #
    129   # If this looks overwhelming, either stick with a preinstalled system font and set
    130   # POWERLEVEL9K_MODE=compatible, or install the recommended Powerlevel10k font from
    131   # https://github.com/romkatv/powerlevel10k/#recommended-meslo-nerd-font-patched-for-powerlevel10k
    132   # and set POWERLEVEL9K_MODE=nerdfont-complete.
    133   typeset -g POWERLEVEL9K_MODE=nerdfont-complete
    134 
    135   # When set to true, icons appear before content on both sides of the prompt. When set
    136   # to false, icons go after content. If empty or not set, icons go before content in the left
    137   # prompt and after content in the right prompt.
    138   #
    139   # You can also override it for a specific segment:
    140   #
    141   #   POWERLEVEL9K_STATUS_ICON_BEFORE_CONTENT=false
    142   #
    143   # Or for a specific segment in specific state:
    144   #
    145   #   POWERLEVEL9K_DIR_NOT_WRITABLE_ICON_BEFORE_CONTENT=false
    146   typeset -g POWERLEVEL9K_ICON_BEFORE_CONTENT=true
    147 
    148   # Add an empty line before each prompt.
    149   typeset -g POWERLEVEL9K_PROMPT_ADD_NEWLINE=true
    150 
    151   # Connect left prompt lines with these symbols.
    152   typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX=
    153   typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_PREFIX=
    154   typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX=
    155   # Connect right prompt lines with these symbols.
    156   typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_SUFFIX=
    157   typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_SUFFIX=
    158   typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_SUFFIX=
    159 
    160   # The left end of left prompt.
    161   typeset -g POWERLEVEL9K_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL=
    162   # The right end of right prompt.
    163   typeset -g POWERLEVEL9K_RIGHT_PROMPT_LAST_SEGMENT_END_SYMBOL=
    164 
    165   # Ruler, a.k.a. the horizontal line before each prompt. If you set it to true, you'll
    166   # probably want to set POWERLEVEL9K_PROMPT_ADD_NEWLINE=false above and
    167   # POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR=' ' below.
    168   typeset -g POWERLEVEL9K_SHOW_RULER=false
    169   typeset -g POWERLEVEL9K_RULER_CHAR='─'        # reasonable alternative: '·'
    170   typeset -g POWERLEVEL9K_RULER_FOREGROUND=240
    171 
    172   # Filler between left and right prompt on the first prompt line. You can set it to '·' or '─'
    173   # to make it easier to see the alignment between left and right prompt and to separate prompt
    174   # from command output. It serves the same purpose as ruler (see above) without increasing
    175   # the number of prompt lines. You'll probably want to set POWERLEVEL9K_SHOW_RULER=false
    176   # if using this. You might also like POWERLEVEL9K_PROMPT_ADD_NEWLINE=false for more compact
    177   # prompt.
    178   typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR=' '
    179   if [[ $POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR != ' ' ]]; then
    180     # The color of the filler.
    181     typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND=240
    182     # Add a space between the end of left prompt and the filler.
    183     typeset -g POWERLEVEL9K_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL=' '
    184     # Add a space between the filler and the start of right prompt.
    185     typeset -g POWERLEVEL9K_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL=' '
    186     # Start filler from the edge of the screen if there are no left segments on the first line.
    187     typeset -g POWERLEVEL9K_EMPTY_LINE_LEFT_PROMPT_FIRST_SEGMENT_END_SYMBOL='%{%}'
    188     # End filler on the edge of the screen if there are no right segments on the first line.
    189     typeset -g POWERLEVEL9K_EMPTY_LINE_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='%{%}'
    190   fi
    191 
    192   #################################[ os_icon: os identifier ]##################################
    193   # OS identifier color.
    194   typeset -g POWERLEVEL9K_OS_ICON_FOREGROUND=
    195   # Make the icon bold.
    196   typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION='%B${P9K_CONTENT}'
    197 
    198   ################################[ prompt_char: prompt symbol ]################################
    199   # Green prompt symbol if the last command succeeded.
    200   typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=76
    201   # Red prompt symbol if the last command failed.
    202   typeset -g POWERLEVEL9K_PROMPT_CHAR_ERROR_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=196
    203   # Default prompt symbol.
    204   typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIINS_CONTENT_EXPANSION='λ'
    205   # Prompt symbol in command vi mode.
    206   typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION='❮'
    207   # Prompt symbol in visual vi mode.
    208   typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='Ⅴ'
    209   # Prompt symbol in overwrite vi mode.
    210   typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIOWR_CONTENT_EXPANSION='▶'
    211   typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=true
    212   typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL=''
    213 
    214   ##################################[ dir: current directory ]##################################
    215   # Default current directory color.
    216   typeset -g POWERLEVEL9K_DIR_FOREGROUND=31
    217   # If directory is too long, shorten some of its segments to the shortest possible unique
    218   # prefix. The shortened directory can be tab-completed to the original.
    219   typeset -g POWERLEVEL9K_SHORTEN_STRATEGY=truncate_from_right # truncate_to_unique
    220   # typeset -g POWERLEVEL9K_SHORTEN_DIR_LENGTH=1
    221   # Replace removed segment suffixes with this symbol.
    222   typeset -g POWERLEVEL9K_SHORTEN_DELIMITER=
    223   # Color of the shortened directory segments.
    224   typeset -g POWERLEVEL9K_DIR_SHORTENED_FOREGROUND=103
    225   # Color of the anchor directory segments. Anchor segments are never shortened. The first
    226   # segment is always an anchor.
    227   typeset -g POWERLEVEL9K_DIR_ANCHOR_FOREGROUND=39
    228   # Display anchor directory segments in bold.
    229   typeset -g POWERLEVEL9K_DIR_ANCHOR_BOLD=true
    230   # Don't shorten directories that contain any of these files. They are anchors.
    231   local anchor_files=(
    232     .bzr
    233     .citc
    234     .git
    235     .hg
    236     .node-version
    237     .python-version
    238     .ruby-version
    239     .shorten_folder_marker
    240     .svn
    241     .terraform
    242     CVS
    243     Cargo.toml
    244     composer.json
    245     go.mod
    246     package.json
    247   )
    248   typeset -g POWERLEVEL9K_SHORTEN_FOLDER_MARKER="(${(j:|:)anchor_files})"
    249   # Don't shorten this many last directory segments. They are anchors.
    250   typeset -g POWERLEVEL9K_SHORTEN_DIR_LENGTH=1
    251   # Shorten directory if it's longer than this even if there is space for it. The value can
    252   # be either absolute (e.g., '80') or a percentage of terminal width (e.g, '50%'). If empty,
    253   # directory will be shortened only when prompt doesn't fit or when other parameters demand it
    254   # (see POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS and POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT below).
    255   typeset -g POWERLEVEL9K_DIR_MAX_LENGTH=80
    256   # When `dir` segment is on the last prompt line, try to shorten it enough to leave at least this
    257   # many columns for typing commands.
    258   typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS=40
    259   # When `dir` segment is on the last prompt line, try to shorten it enough to leave at least
    260   # COLUMNS * POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT * 0.01 columns for typing commands.
    261   typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT=50
    262   # If set to true, embed a hyperlink into the directory. Useful for quickly
    263   # opening a directory in the file manager simply by clicking the link.
    264   # Can also be handy when the directory is shortened, as it allows you to see
    265   # the full directory that was used in previous commands.
    266   typeset -g POWERLEVEL9K_DIR_HYPERLINK=false
    267 
    268   # Enable special styling for non-writable directories.
    269   typeset -g POWERLEVEL9K_DIR_SHOW_WRITABLE=true
    270   # Show this icon when the current directory is not writable. POWERLEVEL9K_DIR_SHOW_WRITABLE
    271   # above must be set to true for this parameter to have effect.
    272   # typeset -g POWERLEVEL9K_DIR_NOT_WRITABLE_VISUAL_IDENTIFIER_EXPANSION='⭐'
    273 
    274   # Custom prefix.
    275   # typeset -g POWERLEVEL9K_DIR_PREFIX='%fin '
    276 
    277   # POWERLEVEL9K_DIR_CLASSES allows you to specify custom icons for different directories.
    278   # It must be an array with 3 * N elements. Each triplet consists of:
    279   #
    280   #   1. A pattern against which the current directory is matched. Matching is done with
    281   #      extended_glob option enabled.
    282   #   2. Directory class for the purpose of styling.
    283   #   3. Icon.
    284   #
    285   # Triplets are tried in order. The first triplet whose pattern matches $PWD wins. If there
    286   # are no matches, the directory will have no icon.
    287   #
    288   # Example:
    289   #
    290   #   typeset -g POWERLEVEL9K_DIR_CLASSES=(
    291   #       '~/work(/*)#'  WORK     '(╯°□°)╯︵ ┻━┻'
    292   #       '~(/*)#'       HOME     '⌂'
    293   #       '*'            DEFAULT  '')
    294   #
    295   # With these settings, the current directory in the prompt may look like this:
    296   #
    297   #   (╯°□°)╯︵ ┻━┻ ~/work/projects/important/urgent
    298   #
    299   # Or like this:
    300   #
    301   #   ⌂ ~/best/powerlevel10k
    302   #
    303   # You can also set different colors for directories of different classes. Remember to override
    304   # FOREGROUND, SHORTENED_FOREGROUND and ANCHOR_FOREGROUND for every directory class that you wish
    305   # to have its own color.
    306   #
    307   #   typeset -g POWERLEVEL9K_DIR_WORK_FOREGROUND=31
    308   #   typeset -g POWERLEVEL9K_DIR_WORK_SHORTENED_FOREGROUND=103
    309   #   typeset -g POWERLEVEL9K_DIR_WORK_ANCHOR_FOREGROUND=39
    310   #
    311   # typeset -g POWERLEVEL9K_DIR_CLASSES=()
    312 
    313   #####################################[ vcs: git status ]######################################
    314   # Branch icon. Set this parameter to '\uF126 ' for the popular Powerline branch icon.
    315   typeset -g POWERLEVEL9K_VCS_BRANCH_ICON=
    316   POWERLEVEL9K_VCS_BRANCH_ICON=${(g::)POWERLEVEL9K_VCS_BRANCH_ICON}
    317 
    318   # Untracked files icon. It's really a question mark, your font isn't broken.
    319   # Change the value of this parameter to show a different icon.
    320   typeset -g POWERLEVEL9K_VCS_UNTRACKED_ICON='?'
    321   POWERLEVEL9K_VCS_UNTRACKED_ICON=${(g::)POWERLEVEL9K_VCS_UNTRACKED_ICON}
    322 
    323   # Formatter for Git status.
    324   #
    325   # Example output: master ⇣42⇡42 *42 merge ~42 +42 !42 ?42.
    326   #
    327   # You can edit the function to customize how Git status looks.
    328   #
    329   # VCS_STATUS_* parameters are set by gitstatus plugin. See reference:
    330   # https://github.com/romkatv/gitstatus/blob/master/gitstatus.plugin.zsh.
    331   function my_git_formatter() {
    332     emulate -L zsh
    333 
    334     if [[ -n $P9K_CONTENT ]]; then
    335       # If P9K_CONTENT is not empty, use it. It's either "loading" or from vcs_info (not from
    336       # gitstatus plugin). VCS_STATUS_* parameters are not available in this case.
    337       typeset -g my_git_format=$P9K_CONTENT
    338       return
    339     fi
    340 
    341     if (( $1 )); then
    342       # Styling for up-to-date Git status.
    343       local       meta='%f'     # default foreground
    344       local      clean='%76F'   # green foreground
    345       local   modified='%178F'  # yellow foreground
    346       local  untracked='%39F'   # blue foreground
    347       local conflicted='%196F'  # red foreground
    348     else
    349       # Styling for incomplete and stale Git status.
    350       local       meta='%244F'  # grey foreground
    351       local      clean='%244F'  # grey foreground
    352       local   modified='%244F'  # grey foreground
    353       local  untracked='%244F'  # grey foreground
    354       local conflicted='%244F'  # grey foreground
    355     fi
    356 
    357     local res
    358     local where  # branch name, tag or commit
    359     if [[ -n $VCS_STATUS_LOCAL_BRANCH ]]; then
    360       res+="${clean}${POWERLEVEL9K_VCS_BRANCH_ICON}"
    361       where=${(V)VCS_STATUS_LOCAL_BRANCH}
    362     elif [[ -n $VCS_STATUS_TAG ]]; then
    363       res+="${meta}#"
    364       where=${(V)VCS_STATUS_TAG}
    365     else
    366       res+="${meta}@"
    367       where=${VCS_STATUS_COMMIT[1,8]}
    368     fi
    369 
    370     # If local branch name or tag is at most 32 characters long, show it in full.
    371     # Otherwise show the first 12 … the last 12.
    372     (( $#where > 32 )) && where[13,-13]="…"
    373     res+="${clean}${where//\%/%%}"  # escape %
    374 
    375     # Show tracking branch name if it differs from local branch.
    376     if [[ -n ${VCS_STATUS_REMOTE_BRANCH:#$VCS_STATUS_LOCAL_BRANCH} ]]; then
    377       res+="${meta}:${clean}${(V)VCS_STATUS_REMOTE_BRANCH//\%/%%}"  # escape %
    378     fi
    379 
    380     # ⇣42 if behind the remote.
    381     (( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}⇣${VCS_STATUS_COMMITS_BEHIND}"
    382     # ⇡42 if ahead of the remote; no leading space if also behind the remote: ⇣42⇡42.
    383     (( VCS_STATUS_COMMITS_AHEAD && !VCS_STATUS_COMMITS_BEHIND )) && res+=" "
    384     (( VCS_STATUS_COMMITS_AHEAD  )) && res+="${clean}⇡${VCS_STATUS_COMMITS_AHEAD}"
    385     # *42 if have stashes.
    386     (( VCS_STATUS_STASHES        )) && res+=" ${clean}*${VCS_STATUS_STASHES}"
    387     # 'merge' if the repo is in an unusual state.
    388     [[ -n $VCS_STATUS_ACTION     ]] && res+=" ${conflicted}${VCS_STATUS_ACTION}"
    389     # ~42 if have merge conflicts.
    390     (( VCS_STATUS_NUM_CONFLICTED )) && res+=" ${conflicted}~${VCS_STATUS_NUM_CONFLICTED}"
    391     # +42 if have staged changes.
    392     (( VCS_STATUS_NUM_STAGED     )) && res+=" ${modified}+${VCS_STATUS_NUM_STAGED}"
    393     # !42 if have unstaged changes.
    394     (( VCS_STATUS_NUM_UNSTAGED   )) && res+=" ${modified}!${VCS_STATUS_NUM_UNSTAGED}"
    395     # ?42 if have untracked files. It's really a question mark, your font isn't broken.
    396     # See POWERLEVEL9K_VCS_UNTRACKED_ICON above if you want to use a different icon.
    397     # Remove the next line if you don't want to see untracked files at all.
    398     (( VCS_STATUS_NUM_UNTRACKED  )) && res+=" ${untracked}${POWERLEVEL9K_VCS_UNTRACKED_ICON}${VCS_STATUS_NUM_UNTRACKED}"
    399 
    400     typeset -g my_git_format=$res
    401   }
    402   functions -M my_git_formatter 2>/dev/null
    403 
    404   # Disable the default Git status formatting.
    405   typeset -g POWERLEVEL9K_VCS_DISABLE_GITSTATUS_FORMATTING=true
    406   # Install our own Git status formatter.
    407   typeset -g POWERLEVEL9K_VCS_CONTENT_EXPANSION='${$((my_git_formatter(1)))+${my_git_format}}'
    408   typeset -g POWERLEVEL9K_VCS_LOADING_CONTENT_EXPANSION='${$((my_git_formatter(0)))+${my_git_format}}'
    409   # Enable counters for staged, unstaged, etc.
    410   typeset -g POWERLEVEL9K_VCS_{STAGED,UNSTAGED,UNTRACKED,CONFLICTED,COMMITS_AHEAD,COMMITS_BEHIND}_MAX_NUM=-1
    411 
    412   # Icon color.
    413   typeset -g POWERLEVEL9K_VCS_VISUAL_IDENTIFIER_COLOR=76
    414   typeset -g POWERLEVEL9K_VCS_LOADING_VISUAL_IDENTIFIER_COLOR=244
    415   # Custom icon.
    416   # typeset -g POWERLEVEL9K_VCS_VISUAL_IDENTIFIER_EXPANSION='⭐'
    417   # Custom prefix.
    418   # typeset -g POWERLEVEL9K_VCS_PREFIX='%fon '
    419 
    420   # Show status of repositories of these types. You can add svn and/or hg if you are
    421   # using them. If you do, your prompt may become slow even when your current directory
    422   # isn't in an svn or hg reposotiry.
    423   typeset -g POWERLEVEL9K_VCS_BACKENDS=(git)
    424 
    425   # These settings are used for respositories other than Git or when gitstatusd fails and
    426   # Powerlevel10k has to fall back to using vcs_info.
    427   typeset -g POWERLEVEL9K_VCS_CLEAN_FOREGROUND=76
    428   typeset -g POWERLEVEL9K_VCS_UNTRACKED_FOREGROUND=76
    429   typeset -g POWERLEVEL9K_VCS_MODIFIED_FOREGROUND=178
    430 
    431   ##########################[ status: exit code of the last command ]###########################
    432   # Enable OK_PIPE, ERROR_PIPE and ERROR_SIGNAL status states to allow us to enable, disable and
    433   # style them independently from the regular OK and ERROR state.
    434   typeset -g POWERLEVEL9K_STATUS_EXTENDED_STATES=true
    435 
    436   # Status on success. No content, just an icon. No need to show it if prompt_char is enabled as
    437   # it will signify success by turning green.
    438   typeset -g POWERLEVEL9K_STATUS_OK=false
    439   typeset -g POWERLEVEL9K_STATUS_OK_FOREGROUND=70
    440   typeset -g POWERLEVEL9K_STATUS_OK_VISUAL_IDENTIFIER_EXPANSION='✔'
    441 
    442   # Status when some part of a pipe command fails but the overall exit status is zero. It may look
    443   # like this: 1|0.
    444   typeset -g POWERLEVEL9K_STATUS_OK_PIPE=true
    445   typeset -g POWERLEVEL9K_STATUS_OK_PIPE_FOREGROUND=70
    446   typeset -g POWERLEVEL9K_STATUS_OK_PIPE_VISUAL_IDENTIFIER_EXPANSION='✔'
    447 
    448   # Status when it's just an error code (e.g., '1'). No need to show it if prompt_char is enabled as
    449   # it will signify error by turning red.
    450   typeset -g POWERLEVEL9K_STATUS_ERROR=false
    451   typeset -g POWERLEVEL9K_STATUS_ERROR_FOREGROUND=160
    452   typeset -g POWERLEVEL9K_STATUS_ERROR_VISUAL_IDENTIFIER_EXPANSION='✘'
    453 
    454   # Status when the last command was terminated by a signal.
    455   typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL=true
    456   typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_FOREGROUND=160
    457   # Use terse signal names: "INT" instead of "SIGINT(2)".
    458   typeset -g POWERLEVEL9K_STATUS_VERBOSE_SIGNAME=false
    459   typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_VISUAL_IDENTIFIER_EXPANSION='✘'
    460 
    461   # Status when some part of a pipe command fails and the overall exit status is also non-zero.
    462   # It may look like this: 1|0.
    463   typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE=true
    464   typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_FOREGROUND=160
    465   typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_VISUAL_IDENTIFIER_EXPANSION='✘'
    466 
    467   ###################[ command_execution_time: duration of the last command ]###################
    468   # Show duration of the last command if takes longer than this many seconds.
    469   typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=3
    470   # Show this many fractional digits. Zero means round to seconds.
    471   typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0
    472   # Execution time color.
    473   typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND=101
    474   # Duration format: 1d 2h 3m 4s.
    475   typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FORMAT='d h m s'
    476   # Custom icon.
    477   # typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_VISUAL_IDENTIFIER_EXPANSION='⭐'
    478   # Custom prefix.
    479   # typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PREFIX='%ftook '
    480 
    481   #######################[ background_jobs: presence of background jobs ]#######################
    482   # Don't show the number of background jobs.
    483   typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE=false
    484   # Background jobs color.
    485   typeset -g POWERLEVEL9K_BACKGROUND_JOBS_FOREGROUND=70
    486   # Icon to show when there are background jobs.
    487   typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VISUAL_IDENTIFIER_EXPANSION='⇶'
    488 
    489   #######################[ direnv: direnv status (https://direnv.net/) ]########################
    490   # Direnv color.
    491   typeset -g POWERLEVEL9K_DIRENV_FOREGROUND=178
    492   # Icon to show when direnv is active.
    493   typeset -g POWERLEVEL9K_DIRENV_VISUAL_IDENTIFIER_EXPANSION='${P9K_VISUAL_IDENTIFIER}'
    494 
    495   ##########[ nordvpn: nordvpn connection status, linux only (https://nordvpn.com/) ]###########
    496   # NordVPN connection indicator color.
    497   typeset -g POWERLEVEL9K_NORDVPN_FOREGROUND=39
    498   # Hide NordVPN connection indicator when not connected.
    499   typeset -g POWERLEVEL9K_NORDVPN_{DISCONNECTED,CONNECTING,DISCONNECTING}_CONTENT_EXPANSION=
    500   typeset -g POWERLEVEL9K_NORDVPN_{DISCONNECTED,CONNECTING,DISCONNECTING}_VISUAL_IDENTIFIER_EXPANSION=
    501   # Custom icon.
    502   # typeset -g POWERLEVEL9K_NORDVPN_VISUAL_IDENTIFIER_EXPANSION='⭐'
    503 
    504   #################[ ranger: ranger shell (https://github.com/ranger/ranger) ]##################
    505   # Ranger shell color.
    506   typeset -g POWERLEVEL9K_RANGER_FOREGROUND=178
    507   # Custom icon.
    508   # typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='⭐'
    509 
    510   ######################################[ ram: free RAM ]#######################################
    511   # RAM color.
    512   typeset -g POWERLEVEL9K_RAM_FOREGROUND=66
    513   # Custom icon.
    514   # typeset -g POWERLEVEL9K_RAM_VISUAL_IDENTIFIER_EXPANSION='⭐'
    515 
    516   ######################################[ load: CPU load ]######################################
    517   # Show average CPU load over this many last minutes. Valid values are 1, 5 and 15.
    518   typeset -g POWERLEVEL9K_LOAD_WHICH=5
    519   # Load color when load is under 50%.
    520   typeset -g POWERLEVEL9K_LOAD_NORMAL_FOREGROUND=66
    521   # Load color when load is between 50% and 70%.
    522   typeset -g POWERLEVEL9K_LOAD_WARNING_FOREGROUND=178
    523   # Load color when load is over 70%.
    524   typeset -g POWERLEVEL9K_LOAD_CRITICAL_FOREGROUND=166
    525   # Custom icon.
    526   # typeset -g POWERLEVEL9K_LOAD_VISUAL_IDENTIFIER_EXPANSION='⭐'
    527 
    528   ##################################[ context: user@hostname ]##################################
    529   # Default context color.
    530   typeset -g POWERLEVEL9K_CONTEXT_FOREGROUND=180
    531   # Default context format: %n is username, %m is hostname.
    532   typeset -g POWERLEVEL9K_CONTEXT_TEMPLATE='%n@%m'
    533 
    534   # Context color when running with privileges.
    535   typeset -g POWERLEVEL9K_CONTEXT_ROOT_FOREGROUND=178
    536   # Context format when running with privileges: bold user@hostname.
    537   typeset -g POWERLEVEL9K_CONTEXT_ROOT_TEMPLATE='%B%n@%m'
    538 
    539   # Don't show context unless running with privileges or in SSH.
    540   # Tip: Remove the next line to always show context.
    541   typeset -g POWERLEVEL9K_CONTEXT_{DEFAULT,SUDO}_{CONTENT,VISUAL_IDENTIFIER}_EXPANSION=
    542 
    543   # Custom icon.
    544   # typeset -g POWERLEVEL9K_CONTEXT_VISUAL_IDENTIFIER_EXPANSION='⭐'
    545   # Custom prefix.
    546   # typeset -g POWERLEVEL9K_CONTEXT_PREFIX='%fwith '
    547 
    548   ###[ virtualenv: python virtual environment (https://docs.python.org/3/library/venv.html) ]###
    549   # Python virtual environment color.
    550   typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=37
    551   # Don't show Python version next to the virtual environment name.
    552   typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=false
    553   # Separate environment name from Python version only with a space.
    554   typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER=
    555   # Custom icon.
    556   # typeset -g POWERLEVEL9K_VIRTUALENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
    557 
    558   #####################[ anaconda: conda environment (https://conda.io/) ]######################
    559   # Anaconda environment color.
    560   typeset -g POWERLEVEL9K_ANACONDA_FOREGROUND=37
    561   # Don't show Python version next to the anaconda environment name.
    562   typeset -g POWERLEVEL9K_ANACONDA_SHOW_PYTHON_VERSION=false
    563   # Separate environment name from Python version only with a space.
    564   typeset -g POWERLEVEL9K_ANACONDA_{LEFT,RIGHT}_DELIMITER=
    565   # Custom icon.
    566   # typeset -g POWERLEVEL9K_ANACONDA_VISUAL_IDENTIFIER_EXPANSION='⭐'
    567 
    568   ################[ pyenv: python environment (https://github.com/pyenv/pyenv) ]################
    569   # Pyenv color.
    570   typeset -g POWERLEVEL9K_PYENV_FOREGROUND=37
    571   # Don't show the current Python version if it's the same as global.
    572   typeset -g POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW=false
    573   # Custom icon.
    574   # typeset -g POWERLEVEL9K_PYENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
    575 
    576   ##########[ nodenv: node.js version from nodenv (https://github.com/nodenv/nodenv) ]##########
    577   # Nodenv color.
    578   typeset -g POWERLEVEL9K_NODENV_FOREGROUND=70
    579   # Don't show node version if it's the same as global: $(nodenv version-name) == $(nodenv global).
    580   typeset -g POWERLEVEL9K_NODENV_PROMPT_ALWAYS_SHOW=false
    581   # Custom icon.
    582   # typeset -g POWERLEVEL9K_NODENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
    583 
    584   ##############[ nvm: node.js version from nvm (https://github.com/nvm-sh/nvm) ]###############
    585   # Nvm color.
    586   typeset -g POWERLEVEL9K_NVM_FOREGROUND=70
    587   # Custom icon.
    588   # typeset -g POWERLEVEL9K_NVM_VISUAL_IDENTIFIER_EXPANSION='⭐'
    589 
    590   ############[ nodeenv: node.js environment (https://github.com/ekalinin/nodeenv) ]############
    591   # Nodeenv color.
    592   typeset -g POWERLEVEL9K_NODEENV_FOREGROUND=70
    593   # Don't show Node version next to the environment name.
    594   typeset -g POWERLEVEL9K_NODEENV_SHOW_NODE_VERSION=false
    595   # Separate environment name from Node version only with a space.
    596   typeset -g POWERLEVEL9K_NODEENV_{LEFT,RIGHT}_DELIMITER=
    597   # Custom icon.
    598   # typeset -g POWERLEVEL9K_NODEENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
    599 
    600   ##############################[ node_version: node.js version ]###############################
    601   # Node version color.
    602   typeset -g POWERLEVEL9K_NODE_VERSION_FOREGROUND=70
    603   # Show node version only when in a directory tree containing package.json.
    604   typeset -g POWERLEVEL9K_NODE_VERSION_PROJECT_ONLY=true
    605   # Custom icon.
    606   # typeset -g POWERLEVEL9K_NODE_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐'
    607 
    608   #######################[ go_version: go version (https://golang.org) ]########################
    609   # Go version color.
    610   typeset -g POWERLEVEL9K_GO_VERSION_FOREGROUND=37
    611   # Show go version only when in a go project subdirectory.
    612   typeset -g POWERLEVEL9K_GO_VERSION_PROJECT_ONLY=true
    613   # Custom icon.
    614   # typeset -g POWERLEVEL9K_GO_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐'
    615 
    616   #################[ rust_version: rustc version (https://www.rust-lang.org) ]##################
    617   # Rust version color.
    618   typeset -g POWERLEVEL9K_RUST_VERSION_FOREGROUND=37
    619   # Show rust version only when in a rust project subdirectory.
    620   typeset -g POWERLEVEL9K_RUST_VERSION_PROJECT_ONLY=true
    621   # Custom icon.
    622   # typeset -g POWERLEVEL9K_RUST_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐'
    623 
    624   ###############[ dotnet_version: .NET version (https://dotnet.microsoft.com) ]################
    625   # .NET version color.
    626   typeset -g POWERLEVEL9K_DOTNET_VERSION_FOREGROUND=134
    627   # Show .NET version only when in a .NET project subdirectory.
    628   typeset -g POWERLEVEL9K_DOTNET_VERSION_PROJECT_ONLY=true
    629   # Custom icon.
    630   # typeset -g POWERLEVEL9K_DOTNET_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐'
    631 
    632   #############[ rbenv: ruby version from rbenv (https://github.com/rbenv/rbenv) ]##############
    633   # Rbenv color.
    634   typeset -g POWERLEVEL9K_RBENV_FOREGROUND=168
    635   # Hide ruby version if it doesn't come from one of these sources.
    636   typeset -g POWERLEVEL9K_RBENV_SOURCES=(shell local global)
    637   # If set to false, hide ruby version if it's the same as global:
    638   # $(rbenv version-name) == $(rbenv global).
    639   typeset -g POWERLEVEL9K_RBENV_PROMPT_ALWAYS_SHOW=false
    640   # Custom icon.
    641   # typeset -g POWERLEVEL9K_RBENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
    642 
    643   #######################[ rvm: ruby version from rvm (https://rvm.io) ]########################
    644   # Rvm color.
    645   typeset -g POWERLEVEL9K_RVM_FOREGROUND=168
    646   # Don't show @gemset at the end.
    647   typeset -g POWERLEVEL9K_RVM_SHOW_GEMSET=false
    648   # Don't show ruby- at the front.
    649   typeset -g POWERLEVEL9K_RVM_SHOW_PREFIX=false
    650   # Custom icon.
    651   # typeset -g POWERLEVEL9K_RVM_VISUAL_IDENTIFIER_EXPANSION='⭐'
    652 
    653   #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]#############
    654   # Kubernetes context classes for the purpose of using different colors, icons and expansions with
    655   # different contexts.
    656   #
    657   # POWERLEVEL9K_KUBECONTEXT_CLASSES is an array with even number of elements. The first element
    658   # in each pair defines a pattern against which the current kubernetes context gets matched.
    659   # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below)
    660   # that gets matched. If you unset all POWERLEVEL9K_KUBECONTEXT_*CONTENT_EXPANSION parameters,
    661   # you'll see this value in your prompt. The second element of each pair in
    662   # POWERLEVEL9K_KUBECONTEXT_CLASSES defines the context class. Patterns are tried in order. The
    663   # first match wins.
    664   #
    665   # For example, given these settings:
    666   #
    667   #   typeset -g POWERLEVEL9K_KUBECONTEXT_CLASSES=(
    668   #     '*prod*'  PROD
    669   #     '*test*'  TEST
    670   #     '*'       DEFAULT)
    671   #
    672   # If your current kubernetes context is "deathray-testing/default", its class is TEST
    673   # because "deathray-testing/default" doesn't match the pattern '*prod*' but does match '*test*'.
    674   #
    675   # You can define different colors, icons and content expansions for different classes:
    676   #
    677   #   typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_FOREGROUND=28
    678   #   typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐'
    679   #   typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <'
    680   typeset -g POWERLEVEL9K_KUBECONTEXT_CLASSES=(
    681       # '*prod*'  PROD    # These values are examples that are unlikely
    682       # '*test*'  TEST    # to match your needs. Customize them as needed.
    683       '*'       DEFAULT)
    684   typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_FOREGROUND=134
    685 
    686   # typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐'
    687 
    688   # Use POWERLEVEL9K_KUBECONTEXT_CONTENT_EXPANSION to specify the content displayed by kubecontext
    689   # segment. Parameter expansions are very flexible and fast, too. See reference:
    690   # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion.
    691   #
    692   # Within the expansion the following parameters are always available:
    693   #
    694   # - P9K_CONTENT                The content that would've been displayed if there was no content
    695   #                              expansion defined.
    696   # - P9K_KUBECONTEXT_NAME       The current context's name. Corresponds to column NAME in the
    697   #                              output of `kubectl config get-contexts`.
    698   # - P9K_KUBECONTEXT_CLUSTER    The current context's cluster. Corresponds to column CLUSTER in the
    699   #                              output of `kubectl config get-contexts`.
    700   # - P9K_KUBECONTEXT_NAMESPACE  The current context's namespace. Corresponds to column NAMESPACE
    701   #                              in the output of `kubectl config get-contexts`. If there is no
    702   #                              namespace, the parameter is set to "default".
    703   #
    704   # If the context points to Google Kubernetes Engine (GKE) or Elastic Kubernetes Service (EKS),
    705   # the following extra parameters are available:
    706   #
    707   # - P9K_KUBECONTEXT_CLOUD_NAME     Either "gke" or "eks".
    708   # - P9K_KUBECONTEXT_CLOUD_ACCOUNT  Account/project ID.
    709   # - P9K_KUBECONTEXT_CLOUD_ZONE     Availability zone.
    710   # - P9K_KUBECONTEXT_CLOUD_CLUSTER  Cluster.
    711   #
    712   # P9K_KUBECONTEXT_CLOUD_* parameters are derived from P9K_KUBECONTEXT_CLUSTER. For example,
    713   # if P9K_KUBECONTEXT_CLUSTER is "gke_my-account_us-east1-a_my-cluster-01":
    714   #
    715   #   - P9K_KUBECONTEXT_CLOUD_NAME=gke
    716   #   - P9K_KUBECONTEXT_CLOUD_ACCOUNT=my-account
    717   #   - P9K_KUBECONTEXT_CLOUD_ZONE=us-east1-a
    718   #   - P9K_KUBECONTEXT_CLOUD_CLUSTER=my-cluster-01
    719   #
    720   # If P9K_KUBECONTEXT_CLUSTER is "arn:aws:eks:us-east-1:123456789012:cluster/my-cluster-01":
    721   #
    722   #   - P9K_KUBECONTEXT_CLOUD_NAME=eks
    723   #   - P9K_KUBECONTEXT_CLOUD_ACCOUNT=123456789012
    724   #   - P9K_KUBECONTEXT_CLOUD_ZONE=us-east-1
    725   #   - P9K_KUBECONTEXT_CLOUD_CLUSTER=my-cluster-01
    726   typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION='%F{13}${${${:-$KCS_PROFILE}:-$P9K_KUBECONTEXT_CLUSTER}}%f'
    727   # typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION=
    728   # Show P9K_KUBECONTEXT_CLOUD_CLUSTER if it's not empty and fall back to P9K_KUBECONTEXT_NAME.
    729   # POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION+='${P9K_KUBECONTEXT_CLOUD_CLUSTER:-${P9K_KUBECONTEXT_NAME}}'
    730   POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION+='/%F{3}${${:-$P9K_KUBECONTEXT_NAMESPACE}:-default}%f'
    731   # Append the current context's namespace if it's not "default".
    732   # POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION+='${${:-/$P9K_KUBECONTEXT_NAMESPACE}:#/default}'
    733 
    734   # Custom prefix.
    735   # typeset -g POWERLEVEL9K_KUBECONTEXT_PREFIX='%fat '
    736 
    737   ################[ terraform: terraform workspace (https://www.terraform.io) ]#################
    738   # Terraform color.
    739   typeset -g POWERLEVEL9K_TERRAFORM_FOREGROUND=38
    740   # Custom icon.
    741   # typeset -g POWERLEVEL9K_TERRAFORM_VISUAL_IDENTIFIER_EXPANSION='⭐'
    742 
    743   #[ aws: aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) ]#
    744   # AWS profile color.
    745   typeset -g POWERLEVEL9K_AWS_DEFAULT_FOREGROUND=208
    746   # POWERLEVEL9K_AWS_CLASSES is an array with even number of elements. The first element
    747   # in each pair defines a pattern against which the current AWS profile gets matched.
    748   # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below)
    749   # that gets matched. If you unset all POWERLEVEL9K_AWS_*CONTENT_EXPANSION parameters,
    750   # you'll see this value in your prompt. The second element of each pair in
    751   # POWERLEVEL9K_AWS_CLASSES defines the context class. Patterns are tried in order. The
    752   # first match wins.
    753   #
    754   # For example, given these settings:
    755   #
    756   #   typeset -g POWERLEVEL9K_AWS_CLASSES=(
    757   #     '*prod*'  PROD
    758   #     '*test*'  TEST
    759   #     '*'       DEFAULT)
    760   #
    761   # If your current AWS profile is "company_test", its class is TEST
    762   # because "company_test" doesn't match the pattern '*prod*' but does match '*test*'.
    763   #
    764   # You can define different colors, icons and content expansions for different classes:
    765   #
    766   #   typeset -g POWERLEVEL9K_AWS_TEST_FOREGROUND=28
    767   #   typeset -g POWERLEVEL9K_AWS_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐'
    768   #   typeset -g POWERLEVEL9K_AWS_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <'
    769   typeset -g POWERLEVEL9K_AWS_CLASSES=(
    770       # '*prod*'  PROD    # These values are examples that are unlikely
    771       # '*test*'  TEST    # to match your needs. Customize them as needed.
    772       '*'       DEFAULT)
    773   # typeset -g POWERLEVEL9K_AWS_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐'
    774 
    775   #[ aws_eb_env: aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) ]#
    776   # AWS Elastic Beanstalk environment color.
    777   typeset -g POWERLEVEL9K_AWS_EB_ENV_FOREGROUND=70
    778   # Custom icon.
    779   # typeset -g POWERLEVEL9K_AWS_EB_ENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
    780 
    781   ##########[ azure: azure account name (https://docs.microsoft.com/en-us/cli/azure) ]##########
    782   # Azure account name color.
    783   typeset -g POWERLEVEL9K_AZURE_FOREGROUND=32
    784   # Custom icon.
    785   # typeset -g POWERLEVEL9K_AZURE_VISUAL_IDENTIFIER_EXPANSION='⭐'
    786 
    787   ###############################[ public_ip: public IP address ]###############################
    788   # Public IP color.
    789   typeset -g POWERLEVEL9K_PUBLIC_IP_FOREGROUND=94
    790   # Custom icon.
    791   # typeset -g POWERLEVEL9K_PUBLIC_IP_VISUAL_IDENTIFIER_EXPANSION='⭐'
    792 
    793   ########################[ vpn_ip: virtual private network indicator ]#########################
    794   # VPN IP color.
    795   typeset -g POWERLEVEL9K_VPN_IP_FOREGROUND=81
    796   # When on VPN, show just an icon without the IP address.
    797   typeset -g POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION=
    798   # Regular expression for the VPN network interface. Run ifconfig while on VPN to see the
    799   # name of the interface.
    800   typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(wg|(.*tun))[0-9]*'
    801   # Icon to show when on VPN.
    802   typeset -g POWERLEVEL9K_VPN_IP_VISUAL_IDENTIFIER_EXPANSION='${P9K_VISUAL_IDENTIFIER}'
    803 
    804   #########################[ proxy: system-wide http/https/ftp proxy ]##########################
    805   # Proxy color.
    806   typeset -g POWERLEVEL9K_PROXY_FOREGROUND=68
    807   # Custom icon.
    808   # typeset -g POWERLEVEL9K_PROXY_VISUAL_IDENTIFIER_EXPANSION='⭐'
    809 
    810   ################################[ battery: internal battery ]#################################
    811   # Show battery in red when it's below this level and not connected to power supply.
    812   typeset -g POWERLEVEL9K_BATTERY_LOW_THRESHOLD=20
    813   typeset -g POWERLEVEL9K_BATTERY_LOW_FOREGROUND=160
    814   # Show battery in green when it's charging or fully charged.
    815   typeset -g POWERLEVEL9K_BATTERY_{CHARGING,CHARGED}_FOREGROUND=70
    816   # Show battery in yellow when it's discharging.
    817   typeset -g POWERLEVEL9K_BATTERY_DISCONNECTED_FOREGROUND=178
    818   # Battery pictograms going from low to high level of charge.
    819   typeset -g POWERLEVEL9K_BATTERY_STAGES=('%K{232}▁' '%K{232}▂' '%K{232}▃' '%K{232}▄' '%K{232}▅' '%K{232}▆' '%K{232}▇' '%K{232}█')
    820   # Don't show the remaining time to charge/discharge.
    821   typeset -g POWERLEVEL9K_BATTERY_VERBOSE=false
    822 
    823   ####################################[ time: current time ]####################################
    824   # Current time color.
    825   typeset -g POWERLEVEL9K_TIME_FOREGROUND=66
    826   # Format for the current time: 09:51:02. See `man 3 strftime`.
    827   typeset -g POWERLEVEL9K_TIME_FORMAT='%D{%H:%M:%S}'
    828   # If set to true, time will update when you hit enter. This way prompts for the past
    829   # commands will contain the start times of their commands as opposed to the default
    830   # behavior where they contain the end times of their preceding commands.
    831   typeset -g POWERLEVEL9K_TIME_UPDATE_ON_COMMAND=false
    832   # Custom icon.
    833   # typeset -g POWERLEVEL9K_TIME_VISUAL_IDENTIFIER_EXPANSION='⭐'
    834   # Custom prefix.
    835   # typeset -g POWERLEVEL9K_TIME_PREFIX='%fat '
    836 
    837   function prompt_in_nix_shell() {
    838     if test -n "${IN_NIX_SHELL}"; then
    839       if test -n "${NIX_SHELL_PACKAGES}"; then
    840         p10k segment -f yellow -i '🛡' -t "{ ${NIX_SHELL_PACKAGES} }"
    841       else
    842         p10k segment -f yellow -t "🛡"
    843       fi
    844     fi
    845   }
    846 
    847   function prompt_docker_host() {
    848       if test -n "${DOCKER_HOST}"; then
    849           p10k segment -f blue -i '🐋' -t "${DOCKER_HOST}"
    850       fi
    851   }
    852   # User-defined prompt segments may optionally provide an instant_prompt_* function. Its job
    853   # is to generate the prompt segment for display in instant prompt. See
    854   # https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt.
    855   #
    856   # Powerlevel10k will call instant_prompt_* at the same time as the regular prompt_* function
    857   # and will record all `p10k segment` calls it makes. When displaying instant prompt, Powerlevel10k
    858   # will replay these calls without actually calling instant_prompt_*. It is imperative that
    859   # instant_prompt_* always makes the same `p10k segment` calls regardless of environment. If this
    860   # rule is not observed, the content of instant prompt will be incorrect.
    861 
    862   function instant_prompt_in_nix_shell() {
    863     prompt_in_nix_shell
    864   }
    865 
    866   function instant_prompt_docker_host() {
    867       prompt_docker_host
    868   }
    869 
    870   # User-defined prompt segments can be customized the same way as built-in segments.
    871   # typeset -g POWERLEVEL9K_EXAMPLE_FOREGROUND=208
    872   # typeset -g POWERLEVEL9K_EXAMPLE_VISUAL_IDENTIFIER_EXPANSION='⭐'
    873 
    874   # Transient prompt works similarly to the builtin transient_rprompt option. It trims down prompt
    875   # when accepting a command line. Supported values:
    876   #
    877   #   - off:      Don't change prompt when accepting a command line.
    878   #   - always:   Trim down prompt when accepting a command line.
    879   #   - same-dir: Trim down prompt when accepting a command line unless this is the first command
    880   #               typed after changing current working directory.
    881   typeset -g POWERLEVEL9K_TRANSIENT_PROMPT=off
    882 
    883   # Instant prompt mode.
    884   #
    885   #   - off:     Disable instant prompt. Choose this if you've tried instant prompt and found
    886   #              it incompatible with your zsh configuration files.
    887   #   - quiet:   Enable instant prompt and don't print warnings when detecting console output
    888   #              during zsh initialization. Choose this if you've read and understood
    889   #              https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt.
    890   #   - verbose: Enable instant prompt and print a warning when detecting console output during
    891   #              zsh initialization. Choose this if you've never tried instant prompt, haven't
    892   #              seen the warning, or if you are unsure what this all means.
    893   typeset -g POWERLEVEL9K_INSTANT_PROMPT=verbose
    894 
    895   # Hot reload allows you to change POWERLEVEL9K options after Powerlevel10k has been initialized.
    896   # For example, you can type POWERLEVEL9K_BACKGROUND=red and see your prompt turn red. Hot reload
    897   # can slow down prompt by 1-2 milliseconds, so it's better to keep it turned off unless you
    898   # really need it.
    899   typeset -g POWERLEVEL9K_DISABLE_HOT_RELOAD=true
    900 
    901   # If p10k is already loaded, reload configuration.
    902   # This works even with POWERLEVEL9K_DISABLE_HOT_RELOAD=true.
    903   #(( ! $+functions[p10k] )) || p10k reload
    904 }
    905 
    906 (( ${#p10k_config_opts} )) && setopt ${p10k_config_opts[@]}
    907 'builtin' 'unset' 'p10k_config_opts'