diff options
author | Dominik Ritter <dritter03@googlemail.com> | 2016-11-30 00:58:19 +0300 |
---|---|---|
committer | Dominik Ritter <dritter03@googlemail.com> | 2016-11-30 00:58:55 +0300 |
commit | a1b4d44755024972af02a7cecbc291fa8684b7ae (patch) | |
tree | d1e162b6d79a23dd45ac2f0b5e3d855d267fd22b | |
parent | 7a776dc68c3cdf05b7124317088d6c2a5ce7751f (diff) |
Make path separator configurable for dir prompt
Now the path separator can be configured by setting
`POWERLEVEL9K_DIR_PATH_SEPARATOR`
-rwxr-xr-x | powerlevel9k.zsh-theme | 5 |
1 files changed, 5 insertions, 0 deletions
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" |