agkozak / zsh-z

Jump quickly to directories that you have visited "frecently." A native Zsh port of z.sh with added features.
MIT License
2.02k stars 76 forks source link

Feature request: disambiguating subdirectories #54

Open nzbart opened 3 years ago

nzbart commented 3 years ago

Let me know if this already exists, but I couldn't see it in your examples.

It'd be great if we could specify fragments that match parts of the path.

Hypothetical database:

Currently, I can enter z cont<tab> and be presented with a list to choose from. It'd be great if I could enter z pl/cont and have the pl match place, and cont match the content directory, avoiding the need to scroll around in a list.

agkozak commented 3 years ago

Not a bad idea at all. I’ve got cd working for me like that in ZSH, so why not ZSH-z?

The completion function is still very simple. I was going to do a little work on that next. Let’s leave this issue open, and I’ll make sure to address it in time.

Thank you for helping to make this plugin better.

zachriggle commented 3 years ago

This would indeed be neat! It might be useful to have the separator be optional, e.g. z pl/cont as @nzbart suggested, but also as simply z pl cont (with spaces)

agkozak commented 3 years ago

It might be useful to have the separator be optional, e.g. z pl/cont as @nzbart suggested, but also as simply z pl cont

Doesn't that already work? Give it a try. That's a behavior inherited from rupa/z; a space is replace with * and then expanded when you hit tab. The one problem is that whatever came before the space is still displayed as a separate thing on the command line; it doesn't affect the outcome, but it's an ugly bug. The completion system is pretty unhappy about space not being a separator of arguments. Eventually I'll have to do some real zle voodoo to make that go away.