diff options
author | Ben Hilburn <bhilburn@gmail.com> | 2015-07-13 04:07:59 +0300 |
---|---|---|
committer | Ben Hilburn <bhilburn@gmail.com> | 2015-07-13 04:07:59 +0300 |
commit | 20cb4a245ebed1f4ee7bd08494cc6493660023d9 (patch) | |
tree | 7826c89b65d920da6a7b2442127b420e0939cf7e /powerlevel9k.zsh-theme | |
parent | 614422533062a7f945e9654dce69de87c77b9e24 (diff) | |
parent | 50bca4bf2571f4fd427b69e835fa4536ae74fa8f (diff) |
Merging @dritter's work to allow shortened dir segment.
This is PR #54.
Merge remote-tracking branch 'dritter/dritter/shorten_dir_path'
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rw-r--r-- | powerlevel9k.zsh-theme | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index cecb19db..4f75e89b 100644 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -443,7 +443,13 @@ prompt_context() { # Dir: current working directory prompt_dir() { - $1_prompt_segment "$0" "blue" "$DEFAULT_COLOR" '%~' + local current_path='%~' + if [[ -n "$POWERLEVEL9K_SHORTEN_DIR_LENGTH" ]]; then + # shorten path to $POWERLEVEL9K_SHORTEN_DIR_LENGTH + current_path="%$((POWERLEVEL9K_SHORTEN_DIR_LENGTH+1))(c:.../:)%${POWERLEVEL9K_SHORTEN_DIR_LENGTH}c" + fi + + $1_prompt_segment "$0" "blue" "$DEFAULT_COLOR" "$current_path" } # Command number (in local history) |