skim icon indicating copy to clipboard operation
skim copied to clipboard

Support Wildcards / Chain of Fall Backs for "Smart Search"

Open jtrv opened this issue 3 years ago • 0 comments

While speaking of future functionality for the rust file manager kamyaa/joshuto the idea of a "smart search" with a "chain of fall backs" was described in this comment here which also refers to an issue in gokechan/lf that describes an fzf implementation:

gokcehan/lf#69 : maybe an "ultra smart search" could work too (i.e. when there is at least one unescaped wildcard character in the search string, consider it a wildcard search, but if it yields too few results - configurable number try to fill results up to - or if there is no wildcard character, then search as if it was an exact case-sensitive substring search, and if even then there is too few results - still smaller than the configurable number - then try to search with fuzzy search which will consider all characters separately as they all must appear somewhere in the record and in the order given in the search string

and then this comment makes a good case for smart search being more user friendly in practice:

it seems to me that skim doesn't support "smart search" (i.e. the "chain of fallbacks" as I outlined above) which forces one to learn and remember to always put the right character in front of the string which is tedious. Or maybe I misread the documentation?

I also did a quick search and it looks like becheran/wildmatch may be a good choice for implementing the wildcards.

jtrv avatar May 08 '21 19:05 jtrv