From a1b4d44755024972af02a7cecbc291fa8684b7ae Mon Sep 17 00:00:00 2001 From: Dominik Ritter Date: Tue, 29 Nov 2016 22:58:19 +0100 Subject: [PATCH] Make path separator configurable for dir prompt Now the path separator can be configured by setting `POWERLEVEL9K_DIR_PATH_SEPARATOR` --- powerlevel9k.zsh-theme | 5 +++++ 1 file changed, 5 insertions(+) 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"