Closed leahneukirchen closed 7 years ago
Thank you. This is an interesting idea. I'd like to give it more time for consideration, but I'm not sure it fits fzy too well.
I've never found myself wanting to search for words out of order. Maybe others do (please let me know). Though it's something we could add, but it will be extremely tough to score correctly (either very, very slow or not carrying much meaning).
Negation is also a little awkward. When you say "remove matches for 'bar'", if that means removing matches which fuzzy match "bar" I don't think that's a good feature. Fuzzy finding by definition returns false positives. Negating means a user might exclude results by accident, which is bad.
One usecase is e.g. if you have a project structure lib/foo.rb
, test/test_foo.rb
, and you want to open foo
, and then it shows two choices and you'd need to backspace to make them unique.
When you say "remove matches for 'bar'", if that means removing matches which fuzzy match "bar"
Presumably negation would be based on exact matching rather than fuzzy. I've no idea how difficult something like that would be to implement.
I appreciate the desire for this but it doesn't fit well with fzy's algorithm. It might be solved by a better editing interface as #24 proposes.
Fzy has a really nice algorithm! One thing many other fuzzy file finders do is split the input on whitespace and use it as a conjunction, i.e. every word needs to match the line (but in any order). Currently, it's a bit hard to use fzy because all letters would need to be in correct order...
E.g. you want to find a pdf in your home folder belonging to project bar, then you need to type "homebarpdf" currently, but with my proposal, you could type "pdf home bar"... as long as all words match somewhere.
Bonus points for negation, e.g. "pdf -bar home" to remove matches for "bar".