aboutsummaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorDominik Ritter <dritter03@googlemail.com>2016-11-30 00:58:19 +0300
committerDominik Ritter <dritter03@googlemail.com>2016-11-30 00:58:55 +0300
commita1b4d44755024972af02a7cecbc291fa8684b7ae (patch)
treed1e162b6d79a23dd45ac2f0b5e3d855d267fd22b /powerlevel9k.zsh-theme
parent7a776dc68c3cdf05b7124317088d6c2a5ce7751f (diff)
Make path separator configurable for dir prompt
Now the path separator can be configured by setting `POWERLEVEL9K_DIR_PATH_SEPARATOR`
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-xpowerlevel9k.zsh-theme5
1 files changed, 5 insertions, 0 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index 65b88199..9bf09c6f 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -456,6 +456,7 @@ prompt_custom() {
}
# Dir: current working directory
+set_default POWERLEVEL9K_DIR_PATH_SEPARATOR "/"
prompt_dir() {
local current_path='%~'
if [[ -n "$POWERLEVEL9K_SHORTEN_DIR_LENGTH" ]]; then
@@ -503,6 +504,10 @@ prompt_dir() {
esac
fi
+ if [[ "${POWERLEVEL9K_DIR_PATH_SEPARATOR}" != "/" ]]; then
+ current_path=$(echo "${current_path}" | sed "s/\//${POWERLEVEL9K_DIR_PATH_SEPARATOR}/g")
+ fi
+
typeset -AH dir_states
dir_states=(
"DEFAULT" "FOLDER_ICON"