Skip to content

feat: add snacks.nvim and fzf-lua fuzzy picker integrations#201

Open
awerebea wants to merge 1 commit into
cbochs:mainfrom
awerebea:feat/fuzzy-pickers
Open

feat: add snacks.nvim and fzf-lua fuzzy picker integrations#201
awerebea wants to merge 1 commit into
cbochs:mainfrom
awerebea:feat/fuzzy-pickers

Conversation

@awerebea

Copy link
Copy Markdown

Summary

  • Add lua/grapple/extensions/snacks.lua and lua/grapple/extensions/fzf_lua.lua
    picker adapters, mirroring telescope's tag selection (<CR>), deletion (<C-x>),
    and rename (<C-r>) actions
  • Add <C-f> keymap inside the Grapple tags window to hand off to a fuzzy picker;
    controlled by the new fuzzy_picker setting (default "auto")
  • Add Grapple.open_snacks() and Grapple.open_fzf() to the public API and
    :Grapple open_snacks / :Grapple open_fzf commands
  • Update README.md and doc/grapple.txt with integration docs and new default
    settings entry

Details

The fuzzy_picker = "auto" setting selects the first available picker at runtime
in the order: snacks -> fzf-lua -> telescope. Set to a specific string to pin the
picker, or false to disable <C-f> entirely.

The snacks adapter passes file and pos fields for native file preview with
cursor positioning. The fzf-lua adapter uses path:lnum:col entry format, which
the builtin previewer parses for cursor placement, with a reverse-lookup table to
map selected entries back to tags.

Add two new fuzzy picker adapters mirroring the existing telescope
integration. Both support tag selection (Enter), deletion (Ctrl-x),
and rename (Ctrl-r). fzf-lua additionally supports multi-select
deletion via Tab + Ctrl-x.

New public API:
  require("grapple").open_snacks(opts)
  require("grapple").open_fzf(opts)

Both are also reachable via :Grapple open_snacks and :Grapple open_fzf.

Add fuzzy_picker setting (default "auto") that controls which picker is
opened by the new <C-f> keymap inside the Grapple tags window. "auto"
tries snacks -> fzf-lua -> telescope in order of availability.

Update README and vimdoc with new integrations, fuzzy_picker setting
description, and the <C-f> tags-window action.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant