mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-11-16 17:50:09 +00:00
Limit to whole folders, not just characters.
This commit is contained in:
parent
fea1d7ec5e
commit
891f5567fd
2 changed files with 5 additions and 5 deletions
|
@ -115,8 +115,8 @@ elements (it is by default), and define a `DEFAULT_USER` in your `~/.zshrc`:
|
||||||
The `dir` segment shows the current working directory. You can limit the output
|
The `dir` segment shows the current working directory. You can limit the output
|
||||||
to a certain length:
|
to a certain length:
|
||||||
|
|
||||||
# Limit to 20 characters
|
# Limit to the last two folders
|
||||||
POWERLEVEL9K_SHORTEN_PWD_LENGTH=20
|
POWERLEVEL9K_SHORTEN_DIR_LENGTH=2
|
||||||
|
|
||||||
#### The 'time' segment
|
#### The 'time' segment
|
||||||
|
|
||||||
|
|
|
@ -319,9 +319,9 @@ prompt_context() {
|
||||||
# Dir: current working directory
|
# Dir: current working directory
|
||||||
prompt_dir() {
|
prompt_dir() {
|
||||||
local current_path='%~'
|
local current_path='%~'
|
||||||
if [[ -n "$POWERLEVEL9K_SHORTEN_PWD_LENGTH" ]]; then
|
if [[ -n "$POWERLEVEL9K_SHORTEN_DIR_LENGTH" ]]; then
|
||||||
# shorten path to $POWERLEVEL9K_SHORTEN_PWD_LENGTH characters
|
# shorten path to $POWERLEVEL9K_SHORTEN_DIR_LENGTH
|
||||||
local current_path="%${POWERLEVEL9K_SHORTEN_PWD_LENGTH}<..<%~%<<"
|
current_path="%$((POWERLEVEL9K_SHORTEN_DIR_LENGTH+1))(c:.../:)%${POWERLEVEL9K_SHORTEN_DIR_LENGTH}c"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$1_prompt_segment $0 blue $DEFAULT_COLOR $current_path
|
$1_prompt_segment $0 blue $DEFAULT_COLOR $current_path
|
||||||
|
|
Loading…
Reference in a new issue