lervag / vimtex

VimTeX: A modern Vim and neovim filetype plugin for LaTeX files.
MIT License
5.53k stars 390 forks source link

fzf-lua support #2419

Closed pitkling closed 2 years ago

pitkling commented 2 years ago

I read about the fzf-support in the help and wanted to try it out, but then realized that it's seemingly fzf.vim-specific, as it does not work. I'm using fzf-lua, which probably simply does not have the fzf#run function that vimtex#fzf#run calls. I get Unknown function: fzf#run when invoking :call vimtex#fzf#run().

Not sure how easily that can be implemented, but I'd hope that it's simply possible to detect fzf-lua and then use a corresponding (hopefully existing) function from it instead of fzf#run.

lervag commented 2 years ago

I don't think it is too hard, but I'm not sure I'm interested in doing the work. I don't use fzf anymore myself, and I never used this endpoint even when I used fzf.

I believe the essentials should be similar:

https://github.com/lervag/vimtex/blob/d3c69cb81487a6f532cadab39f86a79cd689e514/autoload/vimtex/fzf.vim#L27-L33

However, obviously, it has to be translated to Lua. The options may probably be more or less directly translated, and the call to fzf#run is also probably easy to translate to fzf-lua. But I don't know how and I want to prioritize my time for other tings.


However, an alternative that might be interesting is to instead add a similar function that uses the vim.ui.select in neovim. If I did that, then you could configure ui.select on your end to use fzf-lua, then you would essentially get what you want here immediately.

But I would have to find an appropriate way to implement this. 🤔

pitkling commented 2 years ago

No worries, makes sense not to use your limited time for quite specialized requests you're not using yourself. Also, implementing this at some point using the more general vim.ui.select approach seems like a good idea and "the right way" to do it (tbh, I didn't know about that feature before reading about it just now ;)).

Also thanks about the pointers what would need to be adapted when looking at directly supporting fzf-lua. If I find some time I'll might try myself to add a simple direct support.

Should I close this, or do you want to keep it open for the vim.ui.select-approach?

lervag commented 2 years ago

Glad to hear it makes sense. Let's close the issue. I'm considering to make some adaptations for neovim in the future, and I'll keep this in mind. Feel free to open a new issue again in the future if you see VimTeX have more neovim support but still no support for this specifically.