Skip to content
This repository has been archived by the owner on Apr 24, 2020. It is now read-only.

Commit

Permalink
Make home shorthand configurable for dir prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
julienfalque committed Apr 2, 2017
1 parent fa21d8f commit 400da1e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions powerlevel9k.zsh-theme
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 400da1e

Please sign in to comment.