Created
February 27, 2026 10:22
-
-
Save santhalakshminarayana/0e0fe22a24b03f949f20ff5b59b898bd to your computer and use it in GitHub Desktop.
Powerlevel10 .p10.zsh config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Generated by Powerlevel10k configuration wizard on 2026-02-11 at 11:15 IST. | |
| # Based on romkatv/powerlevel10k/config/p10k-pure.zsh, checksum 07533. | |
| # Wizard options: compatible, pure, snazzy, rprompt, 2 lines, sparse, transient_prompt, | |
| # instant_prompt=verbose. | |
| # Type `p10k configure` to generate another config. | |
| # | |
| # Config file for Powerlevel10k with the style of Pure (https://github.com/sindresorhus/pure). | |
| # | |
| # Differences from Pure: | |
| # | |
| # - Git: | |
| # - `@c4d3ec2c` instead of something like `v1.4.0~11` when in detached HEAD state. | |
| # - No automatic `git fetch` (the same as in Pure with `PURE_GIT_PULL=0`). | |
| # | |
| # Apart from the differences listed above, the replication of Pure prompt is exact. This includes | |
| # even the questionable parts. For example, just like in Pure, there is no indication of Git status | |
| # being stale; prompt symbol is the same in command, visual and overwrite vi modes; when prompt | |
| # doesn't fit on one line, it wraps around with no attempt to shorten it. | |
| # | |
| # If you like the general style of Pure but not particularly attached to all its quirks, type | |
| # `p10k configure` and pick "Lean" style. This will give you slick minimalist prompt while taking | |
| # advantage of Powerlevel10k features that aren't present in Pure. | |
| # Temporarily change options. | |
| 'builtin' 'local' '-a' 'p10k_config_opts' | |
| [[ ! -o 'aliases' ]] || p10k_config_opts+=('aliases') | |
| [[ ! -o 'sh_glob' ]] || p10k_config_opts+=('sh_glob') | |
| [[ ! -o 'no_brace_expand' ]] || p10k_config_opts+=('no_brace_expand') | |
| 'builtin' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand' | |
| () { | |
| emulate -L zsh -o extended_glob | |
| # Unset all configuration options. | |
| unset -m '(POWERLEVEL9K_*|DEFAULT_USER)~POWERLEVEL9K_GITSTATUS_DIR' | |
| # Zsh >= 5.1 is required. | |
| [[ $ZSH_VERSION == (5.<1->*|<6->.*) ]] || return | |
| # Prompt colors. | |
| local grey='242' | |
| local red='#FF5C57' | |
| local yellow='#F3F99D' | |
| local blue='#57C7FF' | |
| local magenta='#FF6AC1' | |
| local cyan='#9AEDFE' | |
| local white='#F1F1F0' | |
| # Left prompt segments. | |
| typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=( | |
| # =========================[ Line #1 ]========================= | |
| # context # user@host | |
| dir # current directory | |
| vcs # git status | |
| # command_execution_time # previous command duration | |
| # =========================[ Line #2 ]========================= | |
| newline # \n | |
| # virtualenv # python virtual environment | |
| prompt_char # prompt symbol | |
| ) | |
| # Right prompt segments. | |
| typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=( | |
| # =========================[ Line #1 ]========================= | |
| command_execution_time # previous command duration | |
| virtualenv # python virtual environment | |
| context # user@host | |
| # time # current time | |
| # =========================[ Line #2 ]========================= | |
| newline # \n | |
| ) | |
| # Basic style options that define the overall prompt look. | |
| typeset -g POWERLEVEL9K_BACKGROUND= # transparent background | |
| typeset -g POWERLEVEL9K_{LEFT,RIGHT}_{LEFT,RIGHT}_WHITESPACE= # no surrounding whitespace | |
| typeset -g POWERLEVEL9K_{LEFT,RIGHT}_SUBSEGMENT_SEPARATOR=' ' # separate segments with a space | |
| typeset -g POWERLEVEL9K_{LEFT,RIGHT}_SEGMENT_SEPARATOR= # no end-of-line symbol | |
| typeset -g POWERLEVEL9K_VISUAL_IDENTIFIER_EXPANSION= # no segment icons | |
| # Add an empty line before each prompt except the first. This doesn't emulate the bug | |
| # in Pure that makes prompt drift down whenever you use the Alt-C binding from fzf or similar. | |
| typeset -g POWERLEVEL9K_PROMPT_ADD_NEWLINE=true | |
| # Magenta prompt symbol if the last command succeeded. | |
| typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_{VIINS,VICMD,VIVIS}_FOREGROUND=$magenta | |
| # Red prompt symbol if the last command failed. | |
| typeset -g POWERLEVEL9K_PROMPT_CHAR_ERROR_{VIINS,VICMD,VIVIS}_FOREGROUND=$red | |
| # Default prompt symbol. | |
| typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIINS_CONTENT_EXPANSION='❯' | |
| # Prompt symbol in command vi mode. | |
| typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION='❮' | |
| # Prompt symbol in visual vi mode is the same as in command mode. | |
| typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='❮' | |
| # Prompt symbol in overwrite vi mode is the same as in command mode. | |
| typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=false | |
| # Grey Python Virtual Environment. | |
| typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=$grey | |
| # Don't show Python version. | |
| typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=false | |
| typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER= | |
| # Blue current directory. | |
| typeset -g POWERLEVEL9K_DIR_FOREGROUND=$blue | |
| # Context format when root: user@host. The first part white, the rest grey. | |
| typeset -g POWERLEVEL9K_CONTEXT_ROOT_TEMPLATE="%F{$white}%n%f%F{$grey}@%m%f" | |
| # Context format when not root: user@host. The whole thing grey. | |
| typeset -g POWERLEVEL9K_CONTEXT_TEMPLATE="%F{$grey}%n@%m%f" | |
| # Don't show context unless root or in SSH. | |
| typeset -g POWERLEVEL9K_CONTEXT_{DEFAULT,SUDO}_CONTENT_EXPANSION= | |
| # Show previous command duration only if it's >= 5s. | |
| typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=5 | |
| # Don't show fractional seconds. Thus, 7s rather than 7.3s. | |
| typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0 | |
| # Duration format: 1d 2h 3m 4s. | |
| typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FORMAT='d h m s' | |
| # Yellow previous command duration. | |
| typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND=$yellow | |
| function my_git_formatter() { | |
| emulate -L zsh | |
| if [[ -n $P9K_CONTENT ]]; then | |
| # If P9K_CONTENT is not empty, use it. It's either "loading" or from vcs_info (not from | |
| # gitstatus plugin). VCS_STATUS_* parameters are not available in this case. | |
| typeset -g my_git_format=$P9K_CONTENT | |
| return | |
| fi | |
| if (( $1 )); then | |
| # Styling for up-to-date Git status. | |
| local meta='%248F' | |
| local clean='%253F' | |
| local modified='%50F' | |
| local untracked='%226F' | |
| local conflicted='%196F' | |
| local commits_ahead='%4F' | |
| local commits_behind='%4F' | |
| local stash='%125F' | |
| else | |
| # Styling for incomplete and stale Git status. | |
| local meta='%244F' | |
| local clean='%244F' | |
| local modified='%244F' | |
| local untracked='%244F' | |
| local conflicted='%244F' | |
| local commits_ahead='%244F' | |
| local commits_behind='%244F' | |
| local stash='%244F' | |
| fi | |
| local res | |
| if [[ -n $VCS_STATUS_LOCAL_BRANCH ]]; then | |
| local branch=${(V)VCS_STATUS_LOCAL_BRANCH} | |
| # If local branch name is at most 32 characters long, show it in full. | |
| # Otherwise show the first 12 … the last 12. | |
| # Tip: To always show local branch name in full without truncation, delete the next line. | |
| (( $#branch > 32 )) && branch[13,-13]="…" # <-- this line | |
| res+="${clean}${(g::)POWERLEVEL9K_VCS_BRANCH_ICON}${branch//\%/%%}" | |
| fi | |
| if [[ -n $VCS_STATUS_TAG | |
| # Show tag only if not on a branch. | |
| # Tip: To always show tag, delete the next line. | |
| && -z $VCS_STATUS_LOCAL_BRANCH # <-- this line | |
| ]]; then | |
| local tag=${(V)VCS_STATUS_TAG} | |
| # If tag name is at most 32 characters long, show it in full. | |
| # Otherwise show the first 12 … the last 12. | |
| # Tip: To always show tag name in full without truncation, delete the next line. | |
| (( $#tag > 32 )) && tag[13,-13]="…" # <-- this line | |
| res+="${meta}#${clean}${tag//\%/%%}" | |
| fi | |
| # Display the current Git commit if there is no branch and no tag. | |
| # Tip: To always display the current Git commit, delete the next line. | |
| [[ -z $VCS_STATUS_LOCAL_BRANCH && -z $VCS_STATUS_TAG ]] && # <-- this line | |
| res+="${meta}@${clean}${VCS_STATUS_COMMIT[1,8]}" | |
| # Show tracking branch name if it differs from local branch. | |
| if [[ -n ${VCS_STATUS_REMOTE_BRANCH:#$VCS_STATUS_LOCAL_BRANCH} ]]; then | |
| res+="${meta}:${clean}${(V)VCS_STATUS_REMOTE_BRANCH//\%/%%}" | |
| fi | |
| # Display "wip" if the latest commit's summary contains "wip" or "WIP". | |
| if [[ $VCS_STATUS_COMMIT_SUMMARY == (|*[^[:alnum:]])(wip|WIP)(|[^[:alnum:]]*) ]]; then | |
| res+=" ${modified}wip" | |
| fi | |
| if (( VCS_STATUS_COMMITS_AHEAD || VCS_STATUS_COMMITS_BEHIND )); then | |
| # ⇣42 if behind the remote. | |
| (( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${commits_behind}⇣${VCS_STATUS_COMMITS_BEHIND}" | |
| # ⇡42 if ahead of the remote; no leading space if also behind the remote: ⇣42⇡42. | |
| (( VCS_STATUS_COMMITS_AHEAD && !VCS_STATUS_COMMITS_BEHIND )) && res+=" " | |
| (( VCS_STATUS_COMMITS_AHEAD )) && res+="${commits_ahead}⇡${VCS_STATUS_COMMITS_AHEAD}" | |
| elif [[ -n $VCS_STATUS_REMOTE_BRANCH ]]; then | |
| # Tip: Uncomment the next line to display '=' if up to date with the remote. | |
| # res+=" ${clean}=" | |
| fi | |
| # ⇠42 if behind the push remote. | |
| (( VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" ${commits_behind}⇠${VCS_STATUS_PUSH_COMMITS_BEHIND}" | |
| (( VCS_STATUS_PUSH_COMMITS_AHEAD && !VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" " | |
| # ⇢42 if ahead of the push remote; no leading space if also behind: ⇠42⇢42. | |
| (( VCS_STATUS_PUSH_COMMITS_AHEAD )) && res+="${commits_ahead}⇢${VCS_STATUS_PUSH_COMMITS_AHEAD}" | |
| # *42 if have stashes. | |
| (( VCS_STATUS_STASHES )) && res+=" ${stash}*${VCS_STATUS_STASHES}" | |
| # 'merge' if the repo is in an unusual state. | |
| [[ -n $VCS_STATUS_ACTION ]] && res+=" ${conflicted}${VCS_STATUS_ACTION}" | |
| # ~42 if have merge conflicts. | |
| (( VCS_STATUS_NUM_CONFLICTED )) && res+=" ${conflicted}~${VCS_STATUS_NUM_CONFLICTED}" | |
| # +42 if have staged changes. | |
| (( VCS_STATUS_NUM_STAGED )) && res+=" ${modified}+${VCS_STATUS_NUM_STAGED}" | |
| # !42 if have unstaged changes. | |
| (( VCS_STATUS_NUM_UNSTAGED )) && res+=" ${modified}!${VCS_STATUS_NUM_UNSTAGED}" | |
| # ?42 if have untracked files. It's really a question mark, your font isn't broken. | |
| # See POWERLEVEL9K_VCS_UNTRACKED_ICON above if you want to use a different icon. | |
| # Remove the next line if you don't want to see untracked files at all. | |
| (( VCS_STATUS_NUM_UNTRACKED )) && res+=" ${untracked}${(g::)POWERLEVEL9K_VCS_UNTRACKED_ICON}${VCS_STATUS_NUM_UNTRACKED}" | |
| # "─" if the number of unstaged files is unknown. This can happen due to | |
| # POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY (see below) being set to a non-negative number lower | |
| # than the number of files in the Git index, or due to bash.showDirtyState being set to false | |
| # in the repository config. The number of staged and untracked files may also be unknown | |
| # in this case. | |
| (( VCS_STATUS_HAS_UNSTAGED == -1 )) && res+=" ${modified}─" | |
| typeset -g my_git_format=$res | |
| } | |
| functions -M my_git_formatter 2>/dev/null | |
| # Don't count the number of unstaged, untracked and conflicted files in Git repositories with | |
| # more than this many files in the index. Negative value means infinity. | |
| # | |
| # If you are working in Git repositories with tens of millions of files and seeing performance | |
| # sagging, try setting POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY to a number lower than the output | |
| # of `git ls-files | wc -l`. Alternatively, add `bash.showDirtyState = false` to the repository's | |
| # config: `git config bash.showDirtyState false`. | |
| typeset -g POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY=-1 | |
| # Don't show Git status in prompt for repositories whose workdir matches this pattern. | |
| # For example, if set to '~', the Git repository at $HOME/.git will be ignored. | |
| # Multiple patterns can be combined with '|': '~(|/foo)|/bar/baz/*'. | |
| typeset -g POWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN='~' | |
| # Disable the default Git status formatting. | |
| typeset -g POWERLEVEL9K_VCS_DISABLE_GITSTATUS_FORMATTING=true | |
| # Install our own Git status formatter. | |
| typeset -g POWERLEVEL9K_VCS_CONTENT_EXPANSION='${$((my_git_formatter(1)))+${my_git_format}}' | |
| typeset -g POWERLEVEL9K_VCS_LOADING_CONTENT_EXPANSION='${$((my_git_formatter(0)))+${my_git_format}}' | |
| # Enable counters for staged, unstaged, etc. | |
| typeset -g POWERLEVEL9K_VCS_{STAGED,UNSTAGED,UNTRACKED,CONFLICTED,COMMITS_AHEAD,COMMITS_BEHIND}_MAX_NUM=-1 | |
| # Untracked Icon | |
| typeset -g POWERLEVEL9K_VCS_UNTRACKED_ICON='?' | |
| # Icon color. | |
| typeset -g POWERLEVEL9K_VCS_VISUAL_IDENTIFIER_COLOR=76 | |
| typeset -g POWERLEVEL9K_VCS_LOADING_VISUAL_IDENTIFIER_COLOR=244 | |
| # Show status of repositories of these types. You can add svn and/or hg if you are | |
| # using them. If you do, your prompt may become slow even when your current directory | |
| # isn't in an svn or hg reposotiry. | |
| typeset -g POWERLEVEL9K_VCS_BACKENDS=(git) | |
| # These settings are used for repositories other than Git or when gitstatusd fails and | |
| # Powerlevel10k has to fall back to using vcs_info. | |
| typeset -g POWERLEVEL9K_VCS_CLEAN_FOREGROUND=76 | |
| typeset -g POWERLEVEL9K_VCS_UNTRACKED_FOREGROUND=76 | |
| typeset -g POWERLEVEL9K_VCS_MODIFIED_FOREGROUND=178 | |
| # Grey current time. | |
| typeset -g POWERLEVEL9K_TIME_FOREGROUND=$grey | |
| # Format for the current time: 09:51:02. See `man 3 strftime`. | |
| typeset -g POWERLEVEL9K_TIME_FORMAT='%D{%H:%M:%S}' | |
| # If set to true, time will update when you hit enter. This way prompts for the past | |
| # commands will contain the start times of their commands rather than the end times of | |
| # their preceding commands. | |
| typeset -g POWERLEVEL9K_TIME_UPDATE_ON_COMMAND=false | |
| # Transient prompt works similarly to the builtin transient_rprompt option. It trims down prompt | |
| # when accepting a command line. Supported values: | |
| # | |
| # - off: Don't change prompt when accepting a command line. | |
| # - always: Trim down prompt when accepting a command line. | |
| # - same-dir: Trim down prompt when accepting a command line unless this is the first command | |
| # typed after changing current working directory. | |
| typeset -g POWERLEVEL9K_TRANSIENT_PROMPT=always | |
| # Instant prompt mode. | |
| # | |
| # - off: Disable instant prompt. Choose this if you've tried instant prompt and found | |
| # it incompatible with your zsh configuration files. | |
| # - quiet: Enable instant prompt and don't print warnings when detecting console output | |
| # during zsh initialization. Choose this if you've read and understood | |
| # https://github.com/romkatv/powerlevel10k#instant-prompt. | |
| # - verbose: Enable instant prompt and print a warning when detecting console output during | |
| # zsh initialization. Choose this if you've never tried instant prompt, haven't | |
| # seen the warning, or if you are unsure what this all means. | |
| typeset -g POWERLEVEL9K_INSTANT_PROMPT=verbose | |
| # Hot reload allows you to change POWERLEVEL9K options after Powerlevel10k has been initialized. | |
| # For example, you can type POWERLEVEL9K_BACKGROUND=red and see your prompt turn red. Hot reload | |
| # can slow down prompt by 1-2 milliseconds, so it's better to keep it turned off unless you | |
| # really need it. | |
| typeset -g POWERLEVEL9K_DISABLE_HOT_RELOAD=true | |
| # If p10k is already loaded, reload configuration. | |
| # This works even with POWERLEVEL9K_DISABLE_HOT_RELOAD=true. | |
| (( ! $+functions[p10k] )) || p10k reload | |
| } | |
| # Tell `p10k configure` which file it should overwrite. | |
| typeset -g POWERLEVEL9K_CONFIG_FILE=${${(%):-%x}:a} | |
| (( ${#p10k_config_opts} )) && setopt ${p10k_config_opts[@]} | |
| 'builtin' 'unset' 'p10k_config_opts' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment