Skip to content

disrupted/frizbee.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

frizbee.nvim

High-performance fuzzy matching for Neovim, powered by the Rust frizbee library.

The plugin consists of:

  • A native Rust backend (frizbee_nvim) compiled to a shared library.
  • A Lua wrapper (require('frizbee')) that loads the backend automatically and exposes a stable API.

Installation

lazy.nvim

{
  "disrupted/frizbee.nvim",
  build = "cargo build --release",
}

The backend is loaded lazily on first call; there is no startup cost.

API

local frizbee = require('frizbee')

frizbee.match(query, texts, opts?) -> matches

Fuzzy-match query against an array of strings. Returns ranked results.

Parameters

Name Type Description
query string The search query
texts string[] Array of candidate strings
opts table|nil Options (see below)

Options

Field Type Default Description
max_typos integer|nil 0 Max allowed missing chars. nil = unlimited.
limit integer|nil nil Max results to return. nil = all.
sort boolean|nil true Sort by score descending.
with_positions boolean|nil false Include match positions.
case_sensitive boolean|nil false Case-sensitive matching.

Returns table[] — array of match objects:

Field Type Description
index integer 1-based index into texts
score number Match score (higher = better)
exact boolean Whether the match is exact
positions integer[]|nil 1-based positions (only with with_positions = true)

Empty query: returns all items with score = 0 and exact = false, capped by limit.

Example

local matches = frizbee.match("src", {
  "src/main.rs",
  "src/lib.rs",
  "Cargo.toml",
  "README.md",
}, { limit = 10 })

for _, m in ipairs(matches) do
  print(m.index, m.score, m.exact)
end

frizbee.match_indices(query, text, opts?) -> integer[]|nil

Return 1-based match positions for a single query/text pair.

Parameters

Name Type Description
query string The search query
text string A single candidate string
opts table|nil Same options as match() (only max_typos, case_sensitive used)

Returns integer[] of 1-based positions, or nil if no match or empty query.

Example

local pos = frizbee.match_indices("fb", "fooBar")
-- pos = { 1, 4 }

Troubleshooting

:checkhealth frizbee

Reports platform, library extension, searched paths, and native module status.

About

fuzzy matching for Neovim, powered by Rust frizbee

Topics

Resources

License

Stars

Watchers

Forks

Contributors