aboutsummaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorBen Hilburn <bhilburn@gmail.com>2016-01-06 00:07:01 +0300
committerBen Hilburn <bhilburn@gmail.com>2016-01-06 00:07:01 +0300
commit2945c9344485193540dde46db81cd7d5064a2b9f (patch)
treeeda2ae568fce5268116bfaaa4a0b2298fbc76d6f /powerlevel9k.zsh-theme
parent4437e539e9541251746b0917bfd0aea1ffa3493a (diff)
parente7e11d5ec87f30323d065100c1e8fdb4a98c3aba (diff)
Merge pull request #174 from niklas-heer/shorten-fish_like
added fish-like shortening strategy
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-xpowerlevel9k.zsh-theme8
1 files changed, 5 insertions, 3 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index 19c5ea98..706c198a 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -407,15 +407,17 @@ prompt_dir() {
local current_path='%~'
if [[ -n "$POWERLEVEL9K_SHORTEN_DIR_LENGTH" ]]; then
+ set_default POWERLEVEL9K_SHORTEN_DELIMITER ".."
+
case "$POWERLEVEL9K_SHORTEN_STRATEGY" in
truncate_middle)
- current_path=$(pwd | sed -e "s,^$HOME,~," | sed $SED_EXTENDED_REGEX_PARAMETER "s/([^/]{$POWERLEVEL9K_SHORTEN_DIR_LENGTH})[^/]+([^/]{$POWERLEVEL9K_SHORTEN_DIR_LENGTH})\//\1\.\.\2\//g")
+ current_path=$(pwd | sed -e "s,^$HOME,~," | sed $SED_EXTENDED_REGEX_PARAMETER "s/([^/]{$POWERLEVEL9K_SHORTEN_DIR_LENGTH})[^/]+([^/]{$POWERLEVEL9K_SHORTEN_DIR_LENGTH})\//\1$POWERLEVEL9K_SHORTEN_DELIMITER\2\//g")
;;
truncate_from_right)
- current_path=$(pwd | sed -e "s,^$HOME,~," | sed $SED_EXTENDED_REGEX_PARAMETER "s/([^/]{$POWERLEVEL9K_SHORTEN_DIR_LENGTH})[^/]+\//\1..\//g")
+ current_path=$(pwd | sed -e "s,^$HOME,~," | sed $SED_EXTENDED_REGEX_PARAMETER "s/([^/]{$POWERLEVEL9K_SHORTEN_DIR_LENGTH})[^/]+\//\1$POWERLEVEL9K_SHORTEN_DELIMITER\//g")
;;
*)
- current_path="%$((POWERLEVEL9K_SHORTEN_DIR_LENGTH+1))(c:.../:)%${POWERLEVEL9K_SHORTEN_DIR_LENGTH}c"
+ current_path="%$((POWERLEVEL9K_SHORTEN_DIR_LENGTH+1))(c:$POWERLEVEL9K_SHORTEN_DELIMITER/:)%${POWERLEVEL9K_SHORTEN_DIR_LENGTH}c"
;;
esac