agnoster / agnoster-zsh-theme

A ZSH theme designed to disclose information contextually, with a powerline aesthetic
3.95k stars 583 forks source link

[help] Change Default path to minified version? #154

Closed JGStyle closed 3 years ago

JGStyle commented 3 years ago

Because I use a lot of folders to sort all my projects, when using this theme, the path gets extremely long. I was wondering wether it is possible to instead of always showing the complete path from ~ , if there is a way to show a minified version, which would only show the two relevant directories like PARENTFOLDER/CURRENTFOLDER?

If anyone knows how to do that, id be very thankful

[edit]: Sorry, I wanted to choose the right label, but something didn't work

JGStyle commented 3 years ago

For anyone else wondering, I found the solution

open the zsh-theme file and search for

prompt_dir() {
    prompt_segment blue $PRIMARY_FG ' %~ '
}

this part. Change '%~' to '%n~', n being the amount of levels your path should be displayed save it, then select your won theme in the .zshrc file