DIY Neovim fzy search

submited by
Style Pass
2022-01-13 17:30:04

There are plenty of fuzzy search solutions for Neovim, most notably Telescope  , but sometimes you just want something fast and simple.

Enter fzy  , a fast command line program with a slick search algorithm. It is a good unix citizen, operating on newline delimited lists passed through stdin  , making it easy to integrate into all sorts of tools, including editors.

The four most helpful resources, I found, were the Neovim Lua Guide  , by Timothée Sterle, Heiker Curiel’s post on configuring Neovim with Lua  , the Learn Lua in 15 minutes  guide on “Learn X in Y minutes”, and the official Programming in Lua  book, by Roberto Ierusalimschy.

It’s own documentation shows an example integration with Vim. However, that implementation relies on the system()  function to display the fuzzy finder, which no longer works for interactive commands in Neovim  .

Yes, there is a fzy plugin for neovim  , but why not take the opportunity to learn some Neovim Lua, and write an implementation ourselves.

Leave a Comment