-
Notifications
You must be signed in to change notification settings - Fork 600
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
Dashes in dir names break matching #263
Comments
The difference is just in the querying algorithm. zoxide matches all words in order, whereas fzf matches all characters in order.
We did consider using a variant of fzf's algorithm, but in practice it does not work well for a tool like zoxide. |
Well, it would work much better for me =) [1]: Assuming there is one that behaves like I want. |
For this specific use-case, maybe, but you'd be surprised at the number of results that could show up for a query like
I'm definitely open to improving the algorithm, but I don't think fzf's algorithm is a good fit here. To clarify -- I think fzf is an absolutely beautiful piece of software, which is why zoxide is so tightly integrated with it (see Because the current algorithm is "stricter", I can usually get almost anywhere on my filesystem with a maximum query size of 4 characters, and it's almost never wrong. However, with fzf I usually find myself having to scroll down or enter more characters to get to the correct result.
Absolutely! One good thing that zoxide offers you IMO is a thoroughly documented CLI, for exactly this use case. A lot of people who want custom behaviour simply write their own function z() {
local result
result="$(zoxide query -l | fzf --exit-0 --select-1 --query "$*")" && cd "$result"
} |
I wonder if this is a common use case? We certainly could do the initial filtering after removing non-word characters (unless the keywords also contain non-word characters). If we kept the directory separators, I wonder if this would yield more positive results than mistakes. I haven't used zoxide very long, so I don't have intuition about this. |
Thanks, @ajeetdsouza, this is a great idea, I didn't think about rewriting |
No problem! I've added your suggestion into another thread where we're taking a look at potential improvements for the querying algorithm. Feel free to comment here if you have any further questions. |
I appreciate the strive for precision (vs fzf, which has a picker to resolve it), but still maybe the algorithm could be somehow relaxed in less ambiguous cases than just 2
This is an exact match except for the |
I constantly find me and my zoxide baffled by dashes in directory names:
All the other fuzzy finders (like
fzf
orskim
orctrlp
) work as expected (by me, at least).Is there anything I miss?
The text was updated successfully, but these errors were encountered: