Closed mrbiggfoot closed 7 years ago
You want the fzf binary to not use its preview split and instead script neovim to open a buffer and do something via viml? This is all done without python dependencies, msgpack, and neovim-remote?
fzf could check for NVIM_LISTEN_ADDRESS env var and use msgpack (that's what neovim's interface uses if I'm not mistaken) to communicate with neovim. A vim script function to open the preview window could be implemented in fzf.vim plugin. I don't see where python is needed in this scheme.
This is not possible via rpc
in termopen
?
@janlazo you mean, create a preview window using termopen()? That's bad because neovim's coloring/editing capabilites won't work for the preview window. Or you mean something else?
This one https://github.com/junegunn/fzf/blob/master/plugin/fzf.vim#L700
rpc
is mentioned :h jobstart
which refers to :h msgpack-rpc
If I understand correctly, it's just a way of communication between fzf and neovim... using msgpack over stdin/stdout instead of a socket on NVIM_LISTEN_ADDRESS, correct? I guess it would work too. But there should still be some support in neovim, like: 1) closing the preview window when fzf terminal is closed; 2) closing the file being previewed when the next file is opened for preview, etc. Please let me know if it can be easily done without a dedicated VimL function.
Thanks for the suggestion, but this is definitely not what I want in fzf. I'll never want to implement and maintain extra code for all kinds of external programs (there's nothing special about Neovim and I don't even use it) which will make fzf more complex and less stable.
I see your point. Though, IIUC the main burden would be on fzf.vim, and the change to fzf would be minimal and non-intrusive. Ok, I'll go on with my own hack.
It would be nice to have a native option to preview in a neovim window if fzf is executed in neovim terminal. Currently I use a hack that calls a python script from --preview command. That script communicates with neovim using "neovim" module and calls a vim script function to open a preview window. Looks like the python dependency can be eliminated. It should also be faster and less hacky :)