uivonim icon indicating copy to clipboard operation
uivonim copied to clipboard

A "webview" or similar API

Open mauricioszabo opened this issue 4 years ago • 2 comments

I was thinking about doing some experiments on GUI-based NeoVim implementations, and I was thinking if you do have somekind of "webview" API similar to NyaoVim (https://github.com/rhysd/NyaoVim#ui-plugin-examples, for example).

If so, is there any plug-in making use of it?

mauricioszabo avatar Aug 12 '21 22:08 mauricioszabo

ATM, no and no, unfortunately. The closest thing uivonim has to that is the lua code for the LSP features, but that simply taps into hard-coded UI components.

However, this is a really nice idea that I would be happy to add, and soon. Right now I'm working on getting https://github.com/smolck/uivonim/pull/336 finished which will take time, but once I'm done with that this is something I should be able to look into. In theory, it wouldn't be too terribly difficult; just provide a way to (safely) inject HTML/CSS/JS, and done. The hardest part might just be the security portion of things, although I guess I won't know until I try.

Alternatively, I could perhaps make it such that one can do all the HTML/CSS & scripting in a Lua plugin exclusively, without any HTML or JS files. Only thing is that performance might be too poor compared to a plugin loaded in directly into uivonim (via HTML), since with Lua it'd likely have to communicate over RPC, unless I generated HTML/JS/CSS at runtime based on the Lua code or something.

In any case, what did you have in mind for an API?

smolck avatar Aug 13 '21 01:08 smolck

For now, I think just something that allows you to open a buffer (or even a split, even if it's "outside NeoVim") that's essentially a browser - something to open HTML, CSS, Javascript, etc. It doesn't even have to access Node.JS APIs or anything. The only "new" feature should be a way to send messages back and forth between the webview and the NeoVIM part.

From here on, more things could be added, but for now it seems enough :)

mauricioszabo avatar Aug 13 '21 15:08 mauricioszabo