-
Notifications
You must be signed in to change notification settings - Fork 177
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
Option to priorize exact matches over fuzzy ones #183
Comments
I assume you mean when |
yes |
Seems reasonable. |
I don't personally use fuzzy matching because I agree that it's of lower quality. |
Is there some way to improve it? It seems a shame to offer a setting which seems to negate the primary claim of the tool (intelligent history). |
I'd be open to contributions that improve it. It was contributed by a user and isn't a feature I use myself. I prefer the non-fuzzy matching for how I tend to use mcfly. |
@nedbat matches are weighted by length, per #103 (comment) Having been using it for a while myself I agree the balance could stand to shift further towards shorter matches. Easiest tweak is to add a |
With 0.5.10 just out the fuzzy experience should be dramatically improved. If you have MCFLY_FUZZY=true you'll start with a "fuzzy factor" of 2, or you can set the environment variable to another integer value. Higher values of MCFLY_FUZZY favor shorter and earlier matches; 0 turns it off. In my testing a fuzzy factor of 1 didn't do quite enough to prioritize what I was searching for, and 10+ weighed brevity and start position too heavily over the built-in rank. As I mentioned in the readme I expect the best results to be in the 2-5 range, but I also only have my own history to test with. If you have the time to try a few different settings please report how it works out for you and what MCFLY_FUZZY value you settle on! |
Maybe I'm not getting it, but for me fuzzy search does not work, at least as I'd expect it to work. Having set I used fzf command for searching history file before, and I like their syntax and it might work here as well? Space is delimiter and each entered word has to be present in line, with possibility to negate it using !word, your searches can be made case sensitive/insensitive, etc. |
It was just my bad expectation. explanation: |
not quite: it also prioritizes shorter and earlier matches (higher Borrowing your example further, |
No description provided.
The text was updated successfully, but these errors were encountered: