junegunn / fzf

:cherry_blossom: A command-line fuzzy finder
https://junegunn.github.io/fzf/
MIT License
65.97k stars 2.41k forks source link

[Feature-request] Disabling exact match with `'` in extended-exact mode #338

Closed netei closed 9 years ago

netei commented 9 years ago

When in "extended" mode, it is possible to match a word exactly by prefixing it with '

After using fzf for a while, I found out that I want to exactly match more often then I want to fuzzy match.

That's why I'd like to switch to "extended-exact" mode in my $FZF_DEFAULT_OPTS.

However, what is keeping me from doing it is that it's not possible to fuzzy match one word when you are in "extended-exact" mode.

So what I propose is that it could be possible to fuzzymatch a word in "extended-exact" mode by prefixing it with ' (basically ' would just mean toggle the "mode" from fuzzy to exact for the next word)

junegunn commented 9 years ago

We could do that, though I do not like changing the meaning of ' prefix, which currently only means "quote".

But if you find yourself needing to quote search terms that often (well I don't), it is probably a sign that the ranking algorithm of fzf is suboptimal and we may find room for improvement if we examine the cases. Can you give me some real-life examples where fuzzy matching doesn't work very well?

netei commented 9 years ago

I will try making attention about exactly what I type in fzf and see if they are specific cases where that happens

junegunn commented 9 years ago

Maybe the problem is not in the ranking algorithm but in fzf skipping to the next item as soon as it finds the first match, instead of finding "the best" match (of course for performance considerations)

2015-09-02 1 30 20

junegunn commented 9 years ago

I decided to make ' unquote the term in the mode. Will be included in the next release. I considered other chars like ~ for unquoting, but ' still seems to be a better fit considering that it rarely appears at the front of the line.