Skip to content

[idea] Wire fzf-lua LSP pickers for references, document symbols, and workspace symbols #119

Description

@stanfish06

What

Add keymaps that route LSP actions through fzf-lua's built-in LSP pickers instead of dumping results directly into the quickfix list. Specifically: references, document symbols, and workspace symbols.

Where

lua/config/plugin_config.lua — add inside the LspAttach callback and the fzf setup block (around lines 30–38 for fzf keymaps, line 104 for LspAttach).

Why it matters

The config already uses fzf-lua extensively (<leader><leader> files, <leader>/ live grep, <leader>sl lines, <leader>sb buffers, <leader>gc/gb/gB/gs git pickers). But LSP navigation falls back to raw Neovim behaviour: gd calls vim.lsp.buf.definition which jumps directly, and there are no keymaps for references or symbols at all.

fzf-lua ships first-class LSP pickers (fzf.lsp_references, fzf.lsp_document_symbols, fzf.lsp_live_workspace_symbols) that integrate the same fuzzy-search UX already used for files and grep. Wiring them closes the gap between file/text search and code navigation — you can fuzzy-filter a long references list, preview the call site, and pick the right one, rather than paging through a quickfix list.

Given that several heavy LSPs are enabled simultaneously (pyright + pyrefly for Python, clangd for C/C++), references lists can be large and fuzzy-picking is noticeably more ergonomic.

Suggested implementation sketch

-- inside fzf setup block (only if fzf loaded):
vim.keymap.set("n", "<leader>lr", fzf.lsp_references,              { desc = "LSP references (fzf)" })
vim.keymap.set("n", "<leader>ls", fzf.lsp_document_symbols,        { desc = "LSP document symbols" })
vim.keymap.set("n", "<leader>lS", fzf.lsp_live_workspace_symbols,  { desc = "LSP workspace symbols" })

-- optionally upgrade gd to open in fzf when there are multiple definitions:
vim.keymap.set("n", "gd", fzf.lsp_definitions, { buffer = ev.buf, desc = "Go to definition (fzf)" })

<leader>l is already the formatting namespace; <leader>lr/ls/lS keeps LSP actions grouped. gd upgrade is optional — fzf-lua falls back to a direct jump when there is only one definition, matching current behaviour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions