mirror of
https://github.com/sorin-ionescu/prezto.git
synced 2025-01-23 11:22:17 +08:00
Add pwd-length option 'tail'
This option makes `prompt-pwd` only show the last directory in the path, for minimalist prompts
This commit is contained in:
parent
b3a2a7bfeb
commit
2afa8e43ae
@ -19,6 +19,8 @@ elif [[ "$current_pwd" == (#m)[/~] ]]; then
|
|||||||
unset MATCH
|
unset MATCH
|
||||||
elif zstyle -m ':prezto:module:prompt' pwd-length 'long'; then
|
elif zstyle -m ':prezto:module:prompt' pwd-length 'long'; then
|
||||||
ret_directory=${current_pwd}
|
ret_directory=${current_pwd}
|
||||||
|
elif zstyle -m ':prezto:module:prompt' pwd-length 'tail'; then
|
||||||
|
ret_directory=${current_pwd:t}
|
||||||
else
|
else
|
||||||
ret_directory="${${${${(@j:/:M)${(@s:/:)current_pwd}##.#?}:h}%/}//\%/%%}/${${current_pwd:t}//\%/%%}"
|
ret_directory="${${${${(@j:/:M)${(@s:/:)current_pwd}##.#?}:h}%/}//\%/%%}/${${current_pwd:t}//\%/%%}"
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user