diff options
author | romkatv <roman.perepelitsa@gmail.com> | 2019-08-05 21:23:30 +0300 |
---|---|---|
committer | romkatv <roman.perepelitsa@gmail.com> | 2019-08-05 21:23:30 +0300 |
commit | 59e96984a1cde0c50a1c37e4b8ed9fe7b028b3c4 (patch) | |
tree | 4496ab852844dfb512328d4a613ca11435c7cd5d /config/p10k-classic.zsh | |
parent | d8c509f5c92d850de92417c7fdad4ce7fcb18fb4 (diff) |
be more tolerant towards misconfigured locales; users with non-utf-8 locales will still have broken shells but at least p10k will work
Diffstat (limited to 'config/p10k-classic.zsh')
-rw-r--r-- | config/p10k-classic.zsh | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index cbb4de47..4946a28a 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.zsh @@ -1,19 +1,12 @@ -# Config for Powerlevel10k with classic powerline prompt style. Requires a powerline font. -# The color scheme is suitable for dark terminal background. -# -# Once you've installed Powerlevel10k, run these commands to apply classic style. -# -# curl -fsSL -o ~/p10k-classic.zsh https://raw.githubusercontent.com/romkatv/powerlevel10k/master/config/p10k-classic.zsh -# echo 'source ~/p10k-classic.zsh' >>! ~/.zshrc -# -# To customize your prompt, open ~/p10k-classic.zsh in your favorite text editor, change it and -# restart ZSH. The file is well-documented. +# Config for Powerlevel10k with classic powerline prompt style. Type `p10k configure` to generate +# your own config based on it. # # Tip: Looking for a nice color? Here's a one-liner to print colormap. # # for i in {0..255}; do print -Pn "%${i}F${(l:3::0:)i}%f " ${${(M)$((i%8)):#7}:+$'\n'}; done if [[ -o 'aliases' ]]; then + # Temporarily disable aliases. 'builtin' 'unsetopt' 'aliases' local p9k_classic_restore_aliases=1 else @@ -23,6 +16,7 @@ fi () { emulate -L zsh setopt no_unset + local LC_ALL=C.UTF-8 # Unset all configuration options. This allows you to apply configiguration changes without # restarting zsh. Edit ~/.p10k.zsh and type `source ~/.p10k.zsh`. @@ -277,6 +271,13 @@ fi # typeset -g POWERLEVEL9K_DIR_CLASSES=() #####################################[ vcs: git status ]###################################### + # Branch icon. Set this parameter to '\uF126' for the popular Powerline branch icon. + typeset -g POWERLEVEL9K_VCS_BRANCH_ICON= + + # Untracked files icon. It's really a question mark, your font isn't broken. + # Change the value of this parameter to show a different icon. + typeset -g POWERLEVEL9K_VCS_UNTRACKED_ICON='?' + # Git status: feature:master#tag ⇣42⇡42 *42 merge ~42 +42 !42 ?42. # # You can edit the lines below to customize how Git status looks. @@ -285,7 +286,7 @@ fi # https://github.com/romkatv/gitstatus/blob/master/gitstatus.plugin.zsh. local vcs='' # 'feature' or '@72f5c8a' if not on a branch. - vcs+='${${VCS_STATUS_LOCAL_BRANCH:+%76F${(g::)POWERLEVEL9K_VCS_BRANCH_ICON}${VCS_STATUS_LOCAL_BRANCH//\%/%%}}' + vcs+='${${VCS_STATUS_LOCAL_BRANCH:+%76F'${(g::)POWERLEVEL9K_VCS_BRANCH_ICON}'${VCS_STATUS_LOCAL_BRANCH//\%/%%}}' vcs+=':-%f@%76F${VCS_STATUS_COMMIT[1,8]}}' # ':master' if the tracking branch name differs from local branch. vcs+='${${VCS_STATUS_REMOTE_BRANCH:#$VCS_STATUS_LOCAL_BRANCH}:+%f:%76F${VCS_STATUS_REMOTE_BRANCH//\%/%%}}' @@ -309,17 +310,10 @@ fi # ?42 if have untracked files. It's really a question mark, your font isn't broken. # See POWERLEVEL9K_VCS_UNTRACKED_ICON below if you want to use a different icon. # Remove the next line if you don't want to see untracked files at all. - vcs+='${${VCS_STATUS_NUM_UNTRACKED:#0}:+ %39F${(g::)POWERLEVEL9K_VCS_UNTRACKED_ICON}${VCS_STATUS_NUM_UNTRACKED}}' + vcs+='${${VCS_STATUS_NUM_UNTRACKED:#0}:+ %39F'${(g::)POWERLEVEL9K_VCS_UNTRACKED_ICON}'${VCS_STATUS_NUM_UNTRACKED}}' # If P9K_CONTENT is not empty, leave it unchanged. It's either "loading" or from vcs_info. vcs="\${P9K_CONTENT:-$vcs}" - # Branch icon. Set this parameter to $'\uF126' for the popular Powerline branch icon. - typeset -g POWERLEVEL9K_VCS_BRANCH_ICON= - - # Untracked files icon. It's really a question mark, your font isn't broken. - # Change the value of this parameter to show a different icon. - typeset -g POWERLEVEL9K_VCS_UNTRACKED_ICON='?' - # Disable the default Git status formatting. typeset -g POWERLEVEL9K_VCS_DISABLE_GITSTATUS_FORMATTING=true # Install our own Git status formatter. @@ -330,6 +324,8 @@ fi # Enable counters for staged, unstaged, etc. typeset -g POWERLEVEL9K_VCS_{STAGED,UNSTAGED,UNTRACKED,COMMITS_AHEAD,COMMITS_BEHIND}_MAX_NUM=-1 + # Icon color. + typeset -g POWERLEVEL9K_VCS_VISUAL_IDENTIFIER_COLOR=76 # Custom icon. # typeset -g POWERLEVEL9K_VCS_VISUAL_IDENTIFIER_EXPANSION='⭐' # Custom prefix. |