aboutsummaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorDominik Ritter <dritter03@googlemail.com>2015-06-07 02:06:26 +0300
committerDominik Ritter <dritter03@googlemail.com>2015-06-07 02:06:26 +0300
commit291bcddd103a91c52e8464781c2a07e8a512b028 (patch)
tree22f1b714b537c8f9f08382dd7a89a2398292c82b /powerlevel9k.zsh-theme
parentf7cb946898d501a273b4e193910dd5cac6ac22f1 (diff)
Shorten dir path, if POWERLEVEL9K_SHORTEN_PWD_LENGTH is set.
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rw-r--r--powerlevel9k.zsh-theme8
1 files changed, 7 insertions, 1 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index df0319c7..1cd6a870 100644
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -318,7 +318,13 @@ prompt_context() {
# Dir: current working directory
prompt_dir() {
- $1_prompt_segment $0 blue $DEFAULT_COLOR '%~'
+ local current_path='%~'
+ if [[ -n "$POWERLEVEL9K_SHORTEN_PWD_LENGTH" ]]; then
+ # shorten path to $POWERLEVEL9K_SHORTEN_PWD_LENGTH characters
+ local current_path="%${POWERLEVEL9K_SHORTEN_PWD_LENGTH}<..<%~%<<"
+ fi
+
+ $1_prompt_segment $0 blue $DEFAULT_COLOR $current_path
}
# Command number (in local history)