Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it XDG compliant #20

Open
piegamesde opened this issue May 22, 2020 · 10 comments
Open

Make it XDG compliant #20

piegamesde opened this issue May 22, 2020 · 10 comments
Assignees

Comments

@piegamesde
Copy link

Making the extension XDG compliant should be pretty straightforward: Simply replace local datafile=${ZSHZ_DATA:-${_Z_DATA:-${HOME}/.z}} with local datafile=${ZSHZ_DATA:-${_Z_DATA:-${XDG_DATA_HOME:-$HOME/.local/share}/zsh/z}} (not tested).

Implementing it in a backwards-compatible way is a bit less straightforward though: The default file path case needs to check the legacy location in home first and then handle if it exists.

@agkozak agkozak self-assigned this Jun 10, 2020
@agkozak
Copy link
Owner

agkozak commented Jul 20, 2020

Thanks for the good idea. I'm going to continue thinking about this one.

I see that there's a proposal to have rupa/z do something like what you suggest.

If rupa/z goes down that path, I will, of course, mimic it -- I like having ZSH-z continue to be a drop-in replacement for it. Let's keep this issue open.

@ratijas
Copy link

ratijas commented Dec 11, 2020

I wonder, does it make sense anymore to wait for rupa/z to make the first move? Clearly, that project isn't going anywhere at this rate, and even the project owner himself admitted he doesn't use zsh (anymore?)

@agkozak
Copy link
Owner

agkozak commented Dec 11, 2020

I think @rupa has always been solely a bash user; he was kind enough to rewrite his code so that it would work in zsh as well.

I'm sure I'm not the only person who uses both zsh with ZSH-z and bash with rupa/z, and it's nice to have rupa/z use the same database in bash without any extra configuration. I like the idea of having a tidier home directory (which is what I think XDG primarily aims for), but not at the expense of making the inter-operation of the two tools more complicated.

I'd like to leave this issue open and continue to cogitate about it.

In the meantime, remember that you can always set ZSHZ_DATA (or _Z_DATA, if you're using rupa/z as well) to any file you want.

@eugene-reim
Copy link

eugene-reim commented Jan 2, 2022

In the meantime, remember that you can always set ZSHZ_DATA

I did it and it doesn't work. I added in .zshrc string ZSHZ_DATA=$HOME/.config/zsh/.zhist and it continues to use the file .z in home

@agkozak
Copy link
Owner

agkozak commented Jan 2, 2022

@eugene-reim Strange -- it works for me. Would you mind posting your whole .zshrc so that I can try to pinpoint what's going wrong? Thanks!

@eugene-reim
Copy link

Yep, sure.
zshrc.txt

@agkozak
Copy link
Owner

agkozak commented Jan 2, 2022

In line 93, you have

plugins=(z git sudo zsh-autosuggestions zsh-syntax-highlighting)

z is not my plugin -- that's rupa/z, as packaged by Oh-My-Zsh. If you want to use my plugin, you should follow the instructions here -- you'll want to make sure that you install Zsh-z and change that line to

plugins=(zsh-z git sudo zsh-autosuggestions zsh-syntax-highlighting)

Let me know if that works.

@eugene-reim
Copy link

Oh, sorry, I really didn't notice. I'll try it now, thanks.

@eugene-reim
Copy link

Yeah it works! Thank you so much and happy New Year btw!

@agkozak
Copy link
Owner

agkozak commented Jan 2, 2022

@eugene-reim Happy New Year!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants