Skip to content

Better match algorithm #101

@YodaEmbedding

Description

@YodaEmbedding

smart-open is better at frecency than previous plugins. However (with fzy and defaults), it may underweight exact matches or lack smarter filepath matching heuristics.


smartopen.nvim:

╭──────────────────────── Results ────────────────────────╮
│     base.py demo/pipeline/scheduler                    │
│     smart.py demo/pipeline/scheduler                   │
│     timing.py demo/pipeline/component                  │
│     simple.py demo/pipeline/component                  │
│     parallel.py demo/pipeline/component                │
│     base.py demo/pipeline/component                    │
│     component/__init__.py demo/pipeline                │
│     client_to_server_ping_item.py demo/serialization   │
│     server_to_client_ping.proto protos                 │
│     server_to_client_ping_item.py demo/serialization   │
│     client_to_server_ping.proto protos                 │
│     ping.py demo/io/network                            │
│     pipeline/__init__.py demo                          │
│>    proto/__init__.py demo                             │
╰─────────────────────────────────────────────────────────╯
╭───────────────── Search Files By Name ──────────────────╮
│> pip                                                   0│
╰─────────────────────────────────────────────────────────╯

Seems to overweight frecency.


fff.nvim:

┌ Files ──────────────────────────────────────────────────┐
│   history.py demo/pipeline/scheduler                   │
│   __init__.py demo/pipeline/component                  │
│   __init__.py demo/pipeline/scheduler                  │
│   smart.py demo/pipeline/scheduler                     │
│   frame_id_map.py demo/pipeline                        │
│   defaults.py demo/pipeline/scheduler                  │
│   simple.py demo/pipeline/component                    │
│   parallel.py demo/pipeline/component                  │
│   timing.py demo/pipeline/component                    │
│   base.py demo/pipeline/scheduler                      │
│   base.py demo/pipeline/component                      │
┌─────────────────────────────────────────────────────────┐
│🪿 pip                                          175/180 •│
└─────────────────────────────────────────────────────────┘

Weighs exact matches more? (Disclaimer: minimal use, though I opened demo/proto/init.py a bunch of times to try to bias the frecency.)


fff.nvim uses:

Related:

zf is a fuzzy finder that excels at filtering filepaths:

The goal of zf is to be more accurate than other fuzzy finders when filtering filepaths, but it also functions as a general-purpose fuzzy finder.

Try zf online!


Config:

return {
  "danielfalk/smart-open.nvim",

  dependencies = {
    "kkharji/sqlite.lua",
    "nvim-telescope/telescope.nvim",

    -- Optional. Only required if using match_algorithm fzf.
    { "nvim-telescope/telescope-fzf-native.nvim", build = "make" },

    -- Optional. If installed, native fzy will be used when match_algorithm is fzy.
    { "nvim-telescope/telescope-fzy-native.nvim" },
  },

  lazy = true,

  config = function()
    require("telescope").load_extension("smart_open")
  end,
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions