Anchor git repositories' root in Path segment. #5186
Replies: 5 comments 1 reply
|
I'm looking for something similar. I'd like a variation of the So if I'm in the root of my repo, lets say I can't find a way to force this behavior with omp today. Also happy to open a separate issue if what I'm asking for doesn't overlap with |
|
that's all possible with templates. I'll build one that does exactly that as I have the same behaviour. |
|
So, what's the next step? ;-) |
|
This is my template, which does what you're looking for: "template": "{{ $segment := .Segments.Git }}{{ $icon := \"\uf1d2\" }}{{ if $segment.Dir }} {{ $icon }} <i><b>{{ $segment.RepoName }}{{ if $segment.IsWorkTree}} \ue21c{{ end }}</b></i>{{if ne $segment.RepoName .Path}} \ueaf7{{ trimPrefix $segment.Dir .PWD }}{{ end }}{{ else }} \uea83 {{ path .Path .Location }}{{ end }}{{ if not .Writable }} \uf023{{ end }} ", |
|
Thank you both - for a template and for rewriting it to toml (which I use). I'm now all set, neat! |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Code of Conduct
What would you like to see changed?
Currently when I go into my git repository located somewhere on disk, the path looks like
~/git/projects/private/my-awesome-repository. I would like to be able to see it asmy-awesome-repository, because when I'm working inside the git repo, I don't really care about my global pwd, just the relation to repo's root.Edit: I've just checked the default configuration and it seems it works that way, but I can't find related configuration option(s) in both
PathandGitsegment documentation. I'm sorry for creating an issue for this, I will close it as soon as I find the missing settings.Edit2: ok, it seems that the default configuration uses style
Folderand that's why I thought it covers my need - it doesn't. I want to see the full path everywhere except git repositories.All reactions