feat(zsh): display named directories #5749
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pass Zsh's
%~
prompt specifier to--logical-path
inPROMPT
/RPROMPT
Description
Display the current directory using zsh's
%~
specifier, which shortens paths if they refer to a named directory.Motivation and Context
Named directories are a great feature of zsh and most common zsh prompts use the
%~
specifier to display the current directory in shortened form when possible.Screenshots (if appropriate):
Before (With
directory.truncate_to_repo = false
for emphasis)After (named directory set with
hash -d nvim=~/cfg/nvim
)How Has This Been Tested?
Checklist:
Unsure what testing/documentation this needs, since it's just passing an existing flag to
starship prompt
. I would be happy to make any necessary adjustments.However, I did notice that passing
--logical-path
overridesdirectory.truncate_to_repo
completely, I'm not sure if that's intentional/desired.