sindresorhus / pure

Pretty, minimal and fast ZSH prompt
MIT License
13.12k stars 971 forks source link

Feature Request: Truncate prompt path #660

Open 12bchl opened 1 year ago

12bchl commented 1 year ago

Expose function to "hot truncate" and one to reset.

Will be useful for those deep paths. Would be great to pass argument "diralias" and have that as a temporary home. So if I traverse further, the new folders get tacked on.

Then one to reset of course.

My apologies if this is already possible by some other means, couldn't find a way myself!

Love the prompt, appreciate your work.

martinemde commented 11 months ago

Is it possible to simply set the path in the prompt to be only the dir? I don't need "hot truncate" myself.

TimSpence commented 8 months ago

Are you looking to truncate the path at a fixed number of characters, only show the last segment, or show the last n segments?

Any of these would probably require some refactoring of pure.zsh since the PWD environment variable is evaluated in multiple functions.

martinemde commented 8 months ago

My limited request was simply that I am able to make the prompt not so long. The default oh-my-zsh prompt does what I'm picturing.

Not a big deal though, I'm used to it now.

WillSquire commented 3 weeks ago

I had the same request.

Look at Starship with the pure-preset.