1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-12-25 00:21:58 +00:00

make p10k-pure work without gitstatus

This commit is contained in:
romkatv 2019-10-10 09:58:14 +02:00
parent e31abb850b
commit 6b80091039

View file

@ -6,13 +6,13 @@
# - `@c4d3ec2c` instead of something like `v1.4.0~11` when in detached HEAD state. # - `@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`). # - No automatic `git fetch` (the same as in Pure with `PURE_GIT_PULL=0`).
# #
# The replication of Pure prompt achieved with this config is almost exact. Apart from the # Apart from the differences listed above, the replication of Pure prompt is exact. This includes
# differences listed above, prompt is identical to Pure. This includes even the bad parts. # even the bad parts. For example, just like in Pure, prompt provides no indication of Git status
# For example, just like in Pure, prompt will provide no indication of Git status being stale. # being stale; prompt symbol is the same in command, visual and overwrite vi modes; when prompt
# When prompt doesn't fit on one line, it'll wrap around with no attempt to shorten anything. # doesn't fit on one line, it wraps around with no attempt to shorten anything. This behavior is
# This is likely to make user experience worse than with any other Powerlevel10k config. If # likely to make user experience worse than with any other Powerlevel10k config. If you like the
# you like the general style of Pure but not particularly attached to all its quirks, type # general style of Pure but not particularly attached to all its quirks, type `p10k configure`
# `p10k configure` while having Powerlevel10k theme active and pick lean style. # while having Powerlevel10k theme active and pick lean style.
# Temporarily change options. # Temporarily change options.
'builtin' 'local' '-a' 'p10k_config_opts' 'builtin' 'local' '-a' 'p10k_config_opts'
@ -25,6 +25,9 @@
emulate -L zsh emulate -L zsh
setopt no_unset setopt no_unset
# Unset all configuration options.
unset -m 'POWERLEVEL9K_*'
typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=( typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(
dir # current directory dir # current directory
vcs # git status vcs # git status
@ -36,14 +39,15 @@
) )
typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=() typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=()
# Basic style options that define the overall look of your prompt. # Basic style options that define the overall prompt look.
typeset -g POWERLEVEL9K_BACKGROUND= # transparent background typeset -g POWERLEVEL9K_BACKGROUND= # transparent background
typeset -g POWERLEVEL9K_{LEFT,RIGHT}_{LEFT,RIGHT}_WHITESPACE= # no surrounding whitespace 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}_SUBSEGMENT_SEPARATOR=' ' # separate segments with a space
typeset -g POWERLEVEL9K_{LEFT,RIGHT}_SEGMENT_SEPARATOR= # no end-of-line symbol typeset -g POWERLEVEL9K_{LEFT,RIGHT}_SEGMENT_SEPARATOR= # no end-of-line symbol
typeset -g POWERLEVEL9K_VISUAL_IDENTIFIER_EXPANSION= # disable segment icons typeset -g POWERLEVEL9K_VISUAL_IDENTIFIER_EXPANSION= # disable segment icons
# Add an empty line before each prompt. # 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 typeset -g POWERLEVEL9K_PROMPT_ADD_NEWLINE=true
# Magenta prompt symbol if the last command succeeded. # Magenta prompt symbol if the last command succeeded.
@ -57,38 +61,54 @@
# Prompt symbol in visual vi mode is the same as in command mode. This is unlikely # Prompt symbol in visual vi mode is the same as in command mode. This is unlikely
# to be desired by anyone but that's how Pure does it. # to be desired by anyone but that's how Pure does it.
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='' typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION=''
# Prompt symbol in overwrite vi mode is the same as in command mode. This is unlikely
# to be desired by anyone but that's how Pure does it.
typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=false
# Grey Python Virtual Environment. # Grey Python Virtual Environment.
typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=242 typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=242
# Don't show Python version.
typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=false
typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER=
# Blue current directory. # Blue current directory.
typeset -g POWERLEVEL9K_DIR_FOREGROUND=blue typeset -g POWERLEVEL9K_DIR_FOREGROUND=blue
# Make Git prompt grey in all states. Also make stale prompts appear indistinguishable from # Grey Git prompt. This makes stale prompts indistinguishable from up-to-date ones. This is
# fresh ones. This is unlikely to be desired by anyone but that's how Pure does it. # unlikely to be desired by anyone but that's how Pure does it.
typeset -g POWERLEVEL9K_VCS_FOREGROUND=242 typeset -g POWERLEVEL9K_VCS_FOREGROUND=242
# Disable async loading indicator to make directories that aren't Git repositories # Disable async loading indicator to make directories that aren't git repositories
# indistinguishable from large Git repositories without known state. This is unlikely # indistinguishable from large git repositories without known state. This is unlikely
# to be desired by anyone but that's how Pure does it. # to be desired by anyone but that's how Pure does it.
local vcs='${${P9K_CONTENT:#loading}:+' typeset -g POWERLEVEL9K_VCS_LOADING_TEXT=
# 'feature' or '@72f5c8a' if not on a branch. # Cyan ahead/behind arrows.
vcs+='${${VCS_STATUS_LOCAL_BRANCH//\%/%%}:-%f@${VCS_STATUS_COMMIT[1,8]}}' typeset -g POWERLEVEL9K_VCS_{INCOMING,OUTGOING}_CHANGESFORMAT_FOREGROUND=cyan
# '*' if dirty. # Don't show remote branch, current tag or stashes.
vcs+='${${${:-$VCS_STATUS_HAS_STAGED$VCS_STATUS_HAS_UNSTAGED$VCS_STATUS_HAS_UNTRACKED}:#000}:+*}' typeset -g POWERLEVEL9K_VCS_GIT_HOOKS=(vcs-detect-changes git-untracked git-aheadbehind)
# ⇣ if behind the remote. # Don't show the branh icon.
vcs+='${${VCS_STATUS_COMMITS_BEHIND:#0}:+ %6F⇣}' typeset -g POWERLEVEL9K_VCS_BRANCH_ICON=
# ⇡ if ahead of the remote; no leading space if also behind the remote: ⇣⇡. # When in detached HEAD state, show @commit where branch normally goes.
vcs+='${${VCS_STATUS_COMMITS_AHEAD:#0}:+${${(M)VCS_STATUS_COMMITS_BEHIND:#0}:+ }%6F⇡}}' typeset -g POWERLEVEL9K_VCS_COMMIT_ICON='@'
typeset -g POWERLEVEL9K_VCS_CONTENT_EXPANSION=$vcs # Don't show staged, unstaged, untracked indicators.
typeset -g POWERLEVEL9K_VCS_{STAGED,UNSTAGED,UNTRACKED}_ICON=$'\b'
# Show '*' when there are staged, unstaged or untracked files.
typeset -g POWERLEVEL9K_VCS_DIRTY_ICON='*'
# Show '⇣' if local branch is behind remote.
typeset -g POWERLEVEL9K_VCS_INCOMING_CHANGES_ICON='⇣'
# Show '⇡' if local branch is ahead of remote.
typeset -g POWERLEVEL9K_VCS_OUTGOING_CHANGES_ICON='⇡'
# Don't show the number of commits next to the ahead/behind arrows.
typeset -g POWERLEVEL9K_VCS_{COMMITS_AHEAD,COMMITS_BEHIND}_MAX_NUM=1
# Remove space between '⇣' and '⇡', and get rid of $' \b'.
typeset -g POWERLEVEL9K_VCS_CONTENT_EXPANSION=$'${${P9K_CONTENT/⇣* ⇡/⇣⇡}// \b}'
# Context format when root: user@host. The first part white, the rest grey. # Context format when root: user@host. The first part white, the rest grey.
typeset -g POWERLEVEL9K_CONTEXT_ROOT_CONTENT_EXPANSION='%7F%n%f%242F@%m%f' typeset -g POWERLEVEL9K_CONTEXT_ROOT_TEMPLATE='%7F%n%f%242F@%m%f'
# Context format when connected over SSH: user@host. The whole thing grey. # Context format when not root: user@host. The whole thing grey.
typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_CONTENT_EXPANSION='%242F%n@%m%f' typeset -g POWERLEVEL9K_CONTEXT_TEMPLATE='%242F%n@%m%f'
# Don't show context when not rood and not connected over SSH. # Don't show context unless root or in SSH.
typeset -g POWERLEVEL9K_CONTEXT_CONTENT_EXPANSION= typeset -g POWERLEVEL9K_CONTEXT_{DEFAULT,SUDO}_CONTENT_EXPANSION=
typeset -g POWERLEVEL9K_ALWAYS_SHOW_CONTEXT=true
# Show previous command duration only if it's >= 5s. # Show previous command duration only if it's >= 5s.
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=5 typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=5