Skip to content

[idea] wire fzf-lua as vim.ui.select override #156

@stanfish06

Description

@stanfish06

What

Register fzf-lua as the handler for vim.ui.select, so any plugin or Neovim built-in that calls vim.ui.select(items, opts, callback) automatically gets the fzf picker instead of the default inputlist() prompt.

Where

lua/config/plugin_config.lua — inside the existing if ok and not is_vscode then fzf block (after line 42)

Why it matters

Several workflows already installed in this config silently fall back to the plain inputlist() / vim.fn.input() UI:

  • vim.lsp.buf.code_action() — the "select code action" picker (not currently keybound, but triggered by some LSPs)
  • :LspToggle tab-completion still works, but any future command using vim.ui.select gets the bare menu
  • gitsigns hunk staging in visual mode uses vim.ui.select for conflict resolution choices
  • Any plugin added later (e.g. blink.cmp's snippet selection, nvim-dap's attach picker) benefits automatically

Recommended action

One line in the fzf setup block:

require("fzf-lua").register_ui_select()

This replaces vim.ui.select globally with the fzf picker. To be conservative, it can be scoped to only fire when fzf-lua is loaded (already the case inside the if ok guard). No other changes needed.

Optionally add a keybinding for code actions at the same time:

vim.keymap.set("n", "<leader>la", vim.lsp.buf.code_action, { desc = "LSP code action" })

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