summaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorJulien Falque <julien.falque@gmail.com>2017-03-31 09:13:11 +0300
committerJulien Falque <julien.falque@gmail.com>2017-04-04 09:17:18 +0300
commit708705599d7aff9d445607e8b5f7ff14a591dd35 (patch)
tree5cbe33b836d0b1bf41d2e4cb29502defb3744d80 /powerlevel9k.zsh-theme
parent5a1d9ddb6494d4f8eddc24490dde191a1f06088a (diff)
Make home abbreviation configurable for dir prompt
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 bbd1ec44..2a9a159f 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -613,6 +613,7 @@ prompt_command_execution_time() {
# Dir: current working directory
set_default POWERLEVEL9K_DIR_PATH_SEPARATOR "/"
+set_default POWERLEVEL9K_HOME_FOLDER_ABBREVIATION "~"
prompt_dir() {
local current_path="$(print -P "%~")"
if [[ -n "$POWERLEVEL9K_SHORTEN_DIR_LENGTH" || "$POWERLEVEL9K_SHORTEN_STRATEGY" == "truncate_with_folder_marker" ]]; then
@@ -717,6 +718,10 @@ prompt_dir() {
current_path="$( echo "${current_path}" | sed "s/\//${POWERLEVEL9K_DIR_PATH_SEPARATOR}/g")"
fi
+ if [[ "${POWERLEVEL9K_HOME_FOLDER_ABBREVIATION}" != "~" ]]; then
+ current_path="$( echo "${current_path}" | sed "s/^~/${POWERLEVEL9K_HOME_FOLDER_ABBREVIATION}/")"
+ fi
+
typeset -AH dir_states
dir_states=(
"DEFAULT" "FOLDER_ICON"