Better extension ergonomics? #1628
vunhatchuong
started this conversation in
General
Replies: 1 comment 2 replies
-
The 2 ways you’re describing are the most common, unfortunately attaching metadata is never going to be as seamless as in Telescope as you’re dealing with an external process, once the data is handed over to fzf all it knows is the string entry, there is no awareness of the lua context, so you’re left with 2 options:
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Disclaimer: I'm a Lua and Nvim noob, all my experience with them is from configuring my dotfiles.
This might be a skill issue, but I find creating an extension for
fzf-lua
a bit harder compared toTelescope
. Perhaps there’s a way to implement something similar to Telescope’sregister_extension
.I created fzf-lua-jumplist.nvim based on telescope-jumps.nvim.
In
Telescope
, adding a new picker can be achieved cleanly with the following code:Problem:
The challenge I face with
fzf-lua
is that thePreviewer
andfzf_exec
are separate, yet they depend on each other line by line.This often results in two common solutions:
Embed all necessary information in the
fzf_exec
textpreviewer
to extract the location of the selected text using regex.fzf_exec
becomes cluttered, as you need to include additional data for thepreviewer
. You’re stuck working with regex. :(Store items globally using a dictionary
previewer
fetches the required data from a global dict.Like the disclaimer said I'm a noob so maybe there's another way.
Beta Was this translation helpful? Give feedback.
All reactions