agnoster-zsh-theme
agnoster-zsh-theme copied to clipboard
Add fish-style directory paths
This will add fish-style directory paths when one has shrink_path
installed.
Closes #52
Dumb question: how do you use shrink_path
command in the Theme? I tried copying your theme as a custom theme (removing the IF to force shrink to execute), but I keep getting command not found shrink_path
when opening my terminal.
I was a bit confused about this merge request...... since It's been long that I don't really remember.
But to answer your question directly, I've made my own ( hard-coded ) agnoster-theme that sets the path to be fish like. IE instead of ~/usr/projects/personal/super-proyect
it will show you ~/u/p/p/super-proyect
trimming the initial part.
The code that does that is the following:
local trim_path=$(print -P ' %~ ' | sed -E -e "s#([^a-z]*[a-z])[^/]*/#\1/#g")
prompt_segment blue black $trim_path
You can use my forked version here: https://github.com/aemonge/agnoster-zsh-theme
Or if @gdlm91 is able (cause I can't) to merge it to utilize the shrink_path would be Awesome !
can we still merge this maybe?
It would be my pleasure;) Any thoughts on this @agnoster ?
Does this PR supersede #52? If so, you should put "Closes #52" in the PR summary, so the other PR will be auto-closed if this one gets merged.
@apjanke done
Thanks!
@aemonge / @agnoster any update?
Not from my part. But this I can spend some time during January to work on enabling such feature with a configuration variable :)
If y'all are interested, I added this to my AgnosterJ fork.
https://github.com/apjanke/agnosterj-zsh-theme/commit/e91e59480ed4572e132b9884d280a9bc7f4334a1

I've made a push to enable the trim path by export AGNOSTER_THEME_TRIM=1;
in your ~/.zshr file.
@apjanke what does your pull-request do? Did you implement this by a use of a plugin ?
what does your pull-request do? Did you implement this by a use of a plugin ?
My thingy is a fork of Agnoster, not a Zsh plugin. In my version, no plugin is needed; it just makes use of zsh's native prompt support.