petobens / trueline

Fast and extensible bash powerline prompt with true color and fancy icon support
MIT License
385 stars 36 forks source link

Create a `basename` option for the prompt's working_dir segment #21

Open hbjydev opened 4 years ago

hbjydev commented 4 years ago

Then instead of ~ > Workspace > git-repo we could just have git-repo.

Perhaps allow just having this when you're in a git repo? So it's relative to the repo root?

hbjydev commented 4 years ago

(with regards to the git repo one: git rev-parse --show-toplevel will get the absolute path to the root of the current repository)

petobens commented 4 years ago

At the moment you can set

TRUELINE_WORKING_DIR_ABBREVIATE_PARENT_DIRS=true
TRUELINE_WORKING_DIR_ABBREVIATE_PARENT_DIRS_LENGTH=1

to get ~ > W > git-repo. I think that having some indication of the full path (even as minimal as a single letter) is generally useful.

hbjydev commented 4 years ago

Yes, it is, but it would also be useful (for smaller terminals open alongside an editor on a laptop, for instance) to have a basename-based working_dir as well

petobens commented 4 years ago

Ok. I might consider adding it. Feel free to send a PR in the meantime.

hbjydev commented 4 years ago

If I get the chance, I will. My Bash skills aren't that good though, haha