mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-12-18 05:40:07 +00:00
Make path separator configurable for dir prompt
Now the path separator can be configured by setting `POWERLEVEL9K_DIR_PATH_SEPARATOR`
This commit is contained in:
parent
7a776dc68c
commit
a1b4d44755
1 changed files with 5 additions and 0 deletions
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue