vijaymarupudi / nvim-fzf

A Lua API for using fzf in neovim.
MIT License
340 stars 13 forks source link

Sequence of fzf windows example? #52

Open cpkio opened 1 year ago

cpkio commented 1 year ago

Can I get two sequential fzf windows? Can't get my head around this. I've tried a few variants, but second fzf window is not interactive anyway…

This doesn't work

  coroutine.wrap(function()
    local choices_tags = opts.fzf(render_tagslist(),
      (term.fzf_colors .. ' --header-lines=1 --multi --ansi --prompt="Tags> "'))
    if not choices_tags then return end

…

    local choices_pages = opts.fzf(render_pageslist(),
      (term.fzf_colors .. ' --delimiter="' .. delimiter .. '" --nth=1 --header-lines=1 --multi --ansi --prompt="Pages> "'))
    if not choices_pages then return end

…
  end)()

ADD:

I got it: you have to start sending terminal input (:h terminal-input) on second buffer to make it active (I'm on nvim-nightly), like A or something. It is not started as --TERMINAL--. What I dont understand is why first created buffer is active for input by default and the second one is not.

vijaymarupudi commented 1 year ago

Honestly, not clear why this isn't working either...

This line:

vim.cmd[[startinsert]]

Should be doing the trick...