mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-12-19 05:51:57 +00:00
Add ability to omit the first character in dir path
This commit is contained in:
parent
a58e8bdc8c
commit
b379f03f14
2 changed files with 9 additions and 2 deletions
|
@ -304,9 +304,12 @@ the path shown would be `my-cool-project`. If you navigate to `$HOME/projects/m
|
||||||
|
|
||||||
If you want to customize the directory separator, you could set:
|
If you want to customize the directory separator, you could set:
|
||||||
```zsh
|
```zsh
|
||||||
# You'll need patched awesome-terminal fonts for that example
|
# Double quotes are important here!
|
||||||
POWERLEVEL9K_DIR_PATH_SEPARATOR="%f "$'\uE0B1'" %F"
|
POWERLEVEL9K_DIR_PATH_SEPARATOR="%F{red} $(print_icon 'LEFT_SUBSEGMENT_SEPARATOR') %F{black}"
|
||||||
```
|
```
|
||||||
|
To omit the first character (usually a slash that gets replaced if you set `POWERLEVEL9K_DIR_PATH_SEPARATOR`),
|
||||||
|
you could set `POWERLEVEL9K_DIR_OMIT_FIRST_CHARACTER=true`.
|
||||||
|
|
||||||
|
|
||||||
##### disk_usage
|
##### disk_usage
|
||||||
|
|
||||||
|
|
|
@ -616,6 +616,10 @@ prompt_dir() {
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ "${POWERLEVEL9K_DIR_OMIT_FIRST_CHARACTER}" == "true" ]]; then
|
||||||
|
current_path="${current_path[2,-1]}"
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ "${POWERLEVEL9K_DIR_PATH_SEPARATOR}" != "/" ]]; then
|
if [[ "${POWERLEVEL9K_DIR_PATH_SEPARATOR}" != "/" ]]; then
|
||||||
current_path=$(print -P "${current_path}" | sed "s/\//${POWERLEVEL9K_DIR_PATH_SEPARATOR}/g")
|
current_path=$(print -P "${current_path}" | sed "s/\//${POWERLEVEL9K_DIR_PATH_SEPARATOR}/g")
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue