aboutsummaryrefslogtreecommitdiff
path: root/config/p10k-lean.zsh
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2019-08-05 21:23:30 +0300
committerromkatv <roman.perepelitsa@gmail.com>2019-08-05 21:23:30 +0300
commit59e96984a1cde0c50a1c37e4b8ed9fe7b028b3c4 (patch)
tree4496ab852844dfb512328d4a613ca11435c7cd5d /config/p10k-lean.zsh
parentd8c509f5c92d850de92417c7fdad4ce7fcb18fb4 (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-lean.zsh')
-rw-r--r--config/p10k-lean.zsh33
1 files changed, 14 insertions, 19 deletions
diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh
index 52dcdcf4..8b994bbd 100644
--- a/config/p10k-lean.zsh
+++ b/config/p10k-lean.zsh
@@ -1,13 +1,5 @@
-# Config for Powerlevel10k with lean prompt style. Doesn't require a custom font but can take
-# advantage of it if available. The color scheme is suitable for dark terminal background.
-#
-# Once you've installed Powerlevel10k, run these commands to apply lean style.
-#
-# curl -fsSL -o ~/p10k-lean.zsh https://raw.githubusercontent.com/romkatv/powerlevel10k/master/config/p10k-lean.zsh
-# echo 'source ~/p10k-lean.zsh' >>! ~/.zshrc
-#
-# To customize your prompt, open ~/p10k-lean.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.
#
@@ -24,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`.
@@ -262,6 +255,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.
@@ -270,7 +270,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//\%/%%}}'
@@ -294,17 +294,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.
@@ -315,6 +308,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.