Skip to content
Discussion options

You must be logged in to vote

lgrep_curbuf uses rg (ripgrep) under the hood, so it literally needs a file path to read from disk. Man pages are virtual buffers (buftype=nofile) with no backing file — hence the error.

Your options:

  1. blines — reads buffer contents directly (no disk file needed). Add search pattern:

    FzfLua.blines({ fzf_opts = { ["--query"] = "your_search" } })
  2. Conditional mapping — use blines for nofile buffers:

    vim.keymap.set("n", "<leader>gm", function()
      if vim.bo.buftype == "nofile" then
        FzfLua.blines()
      else
        FzfLua.lgrep_curbuf()
      end
    end)

blines is your best bet here — designed to work with any buffer contents regardless of backing file.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by ibhagwan
Comment options

You must be logged in to vote
1 reply
@ibhagwan
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants