Skip to content

haolian9/beckon.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

an opinionated fuzzy picker

beckon-2024-05-21_20.42.59.mp4

motivation

i need a lightweight fuzzy matching picker in nvim to replace fzf in some specific usecases

design choices, limits, goals/non-goals

  • no cache for dataset
    • for large datasets (say 1 million), consider using fzf
    • may suffer the limits of nvim buffer: memory consumption, highlight, undo history, and something i dont know yet
      • note: the undo history of beckon buffers are disabled
  • no fancy UI
  • no seperated windows for user input and matched result
    • and unexpected user operations to buffers may cause troubles likely
  • default query / placeholder
  • clear the default query when user input something new
  • multiple actions for the picked entry
    • n_{i,o,v,t}, i_c-{m,o,/,t}
    • depends on the source/provider, of course
  • no multiple selection/picking
  • no fzf --nth nor conceal
  • since it's a buffer, you can:
    • have vim modes
    • use motion plugins
  • an impl of vim.ui.select
  • two ui layouts, which equal to fzf --layout={default,reverse}

status

  • just works
  • the use of ffi may crash nvim
  • feature complete
  • performance can be bad

efforts on efficiency

  • incremental matching results
  • load partial results to the buffer
  • merge update events happened in a period
  • minimal lines to add highlights of matched token
    • yet, nvim_set_decoration_provider is not being used.

sources

  • buffers
  • arglist
  • digraphs
  • emojis
  • windows
  • lsp document symbol
  • cmds/history

prerequisites

  • zig 0.12
  • nvim 0.10.*
  • haolian9/infra.nvim

usage

  • zig build -Doptimize=ReleaseSafe
  • require'beckon'.buffers()

credits

natecraddock/zf laid the foundation of this plugin.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks