agnoster-zsh-theme icon indicating copy to clipboard operation
agnoster-zsh-theme copied to clipboard

Add fish-style directory paths

Open xvilo opened this issue 6 years ago • 12 comments

This will add fish-style directory paths when one has shrink_path installed.

Closes #52

xvilo avatar Apr 06 '18 09:04 xvilo

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.

gdlm91 avatar Mar 13 '19 02:03 gdlm91

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 !

aemonge avatar Mar 15 '19 10:03 aemonge

can we still merge this maybe?

xvilo avatar Dec 22 '19 17:12 xvilo

It would be my pleasure;) Any thoughts on this @agnoster ?

aemonge avatar Dec 23 '19 09:12 aemonge

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 avatar Jan 03 '20 02:01 apjanke

@apjanke done

xvilo avatar Jan 03 '20 08:01 xvilo

Thanks!

apjanke avatar Jan 03 '20 10:01 apjanke

@aemonge / @agnoster any update?

xvilo avatar Jan 03 '20 11:01 xvilo

Not from my part. But this I can spend some time during January to work on enabling such feature with a configuration variable :)

aemonge avatar Jan 03 '20 13:01 aemonge

If y'all are interested, I added this to my AgnosterJ fork.

https://github.com/apjanke/agnosterj-zsh-theme/commit/e91e59480ed4572e132b9884d280a9bc7f4334a1

Screen Shot 2020-01-03 at 4 25 00 PM

apjanke avatar Jan 03 '20 21:01 apjanke

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 ?

aemonge avatar Feb 17 '20 11:02 aemonge

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.

apjanke avatar Jun 21 '20 00:06 apjanke