Open btc opened 11 years ago
For example:
z sectlr
would match
/src/server/search_controller
Would z foobar
match /foo1/bar2
or just /path/foo1bar2
?
It would match foo1bar first. This choice is just 1 char away from a perfect substring match. foo1/bar is 2 chars from a substring match.
I'm not super into that sort of fuzzy matching. I like having each argument be a regex, and I'm not sure i'd like some combination of the two. It's tempting to try falling back to this sort of matching if regex doesn't turn up any results, but I wonder if that would increase the frequency of ending up in a dir i didn't expect, which is more irritating to me than nothing happening.
What I have been considering for a while is forcing the arguments to be in order. With that, something like z s e c t l r
would do what you envision, albeit rather tediously. It would simplify some of the code too. I'll probably push a branch with that and see how it feels for a while.
FWIW, pushed 'ordered_args' branch.
Cool. I'll try it out.
I like the idea of fuzzy search but I'm not sure which method I would prefer. I thought about patching my local version of z to support fuzzy search using phonetic matching (e.g. soundex, metaphone) for each component in the path. This would allow matching of paths supporting variation in case or when I make a simple typo. Matching priority order could be exact, regex, and phonetic.
Check this out: fz.
I'd prefer fuzzy search to the current default.
Same with v
, I think fuzzy search would be a better option there too.
Hi. First off, thanks for creating this script. It's fantastic.
How would you feel about augmenting the string matching to perform a fuzzy search? Would you consider merging such a feature upstream?