mfussenegger / nvim-fzy

Fuzzy picker & vim.ui.select implementation via fzy for neovim
GNU General Public License v3.0
55 stars 4 forks source link

Expose a function to customize the fuzzy finder command #37

Closed JafarAbdi closed 1 year ago

JafarAbdi commented 1 year ago

Thanks for creating the package!

What do you think about having an option to expose the fuzzy finder command to the user to make it possible to override it?

The motivation is using fzf which supports streaming, so I don't have to wait until the command to find the items is done (fzy is causing vim to hang if I'm searching in a huge directory)

I already created a branch showing a possible solution https://github.com/JafarAbdi/nvim-fzy/commit/8eb47a63a1693bb70ead5c176e75ea8e4b8a2145

This is a comparison

fzy.command = function(opts)
  return string.format(
    'fzf --height %d --prompt "%s" --preview="" --no-multi',
    opts.height,
    vim.F.if_nil(opts.prompt, "")
  )
end

https://user-images.githubusercontent.com/16278108/233512359-80deea92-d1ec-4977-a0f2-26a3f0f92fdd.mp4

https://user-images.githubusercontent.com/16278108/233512365-8f65a7d7-5633-412c-beb6-bdfdd479a455.mp4

mfussenegger commented 1 year ago

This has crossed my mind on occasion, so why not. Merged it with https://github.com/mfussenegger/nvim-fzy/pull/39