Coder Social home page Coder Social logo

Priorization of best matches about fzf HOT 4 CLOSED

junegunn avatar junegunn commented on August 15, 2024
Priorization of best matches

from fzf.

Comments (4)

justinmk avatar justinmk commented on August 15, 2024

You could try fzf -x (extended mode) and then input 'login (notice the apostrophe at the beginning that indicates "non-fuzzy match".

from fzf.

fisadev avatar fisadev commented on August 15, 2024

It will work for that specific example, but it won't in many others where
the input is partially present on some of the entries. Still chooses other
entries, not evaluating how "similar" they are to the search text.
And that solution doesn't work for zsh or bash integration (ctrl-r, ctrl-t,
...), where fzf is called not by the user, but a function.

Improving the priorization will make it work better in all scenarios, it's
something CtrlP and Command-T already do, is common behaviour in any fuzzy
search mechanism.

I would implement it myself, but my ruby-fu isn't good enough to modify
your code :)

2013/12/18 justinmk [email protected]

You could try fzf -x (extended mode) and then input 'login (notice the
apostrophe at the beginning that indicates "non-fuzzy match".


Reply to this email directly or view it on GitHubhttps://github.com//issues/10#issuecomment-30880600
.

fisa - Juan Pedro Fisanotti

from fzf.

junegunn avatar junegunn commented on August 15, 2024

Hi, fzf does prioritize the candidates, first by the length of the matched substring, then by the length of the whole string. Thus, login comes before loogin or login.sh. However it only does so when the number of the candidates is less than the limit which is by default 1000, in order to avoid the cost of sorting a large list and limit the response time of the query.

This limit can be adjusted with -s option, or with the environment variable FZF_DEFAULT_SORT (the latter is actually undocumented though)

from fzf.

fisadev avatar fisadev commented on August 15, 2024

Then the problem was the number of files on the folder I was using it (17.000).
Tried setting FZF_DEFAULT_SORT to 100000, it worked like a charm, and with no noticeable difference in response times.
Thanks for your help! and for the project :)

from fzf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.