Compress and abbreviate the parts of a pathname into a shorter overall string; for use within a Zsh prompt. Adds some minor styling, such as bold text for the last path section (the current directory).
Download and extract compress-path
to your $PATH
. Then, add the following to your .zshrc
:
export PS1='$(compress-path) >'
If you're using oh-my-zsh
, edit your ~/.oh-my-zsh/your-theme.zsh-theme
and modify the prompt_dir
(or similar) function to look something like this:
prompt_dir() {
prompt_segment blue $CURRENT_FG $(compress-path)
}
compress-path
prefers task
for running tasks - see taskfile.dev for more information. If you don't have task
installed, you can use make
instead.
task build
# or
make build
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.