zedapp / zed

Rethinking code editing.
http://zedapp.org
MIT License
2.21k stars 161 forks source link

NeoVim integration #511

Open UberLambda opened 9 years ago

UberLambda commented 9 years ago

Would integrating Zed with NeoVim's plugin API be feasible without having to edit Zed's core too much? ACE's vi support is unfortunely a bit lacking, but using NeoVim a Zed instance set to use it as the editor backend would behave pretty much like Vim, while being much more flexible about plugins and the GUI.

zefhemel commented 9 years ago

Isn't this a plug-in API to extend neovim itself, rather than to use neovim as an editing component in another editor like Zed? Based on a quick look at the linked page I don't see how integration with Zed would really work. Do you have a more clear idea of this?

UberLambda commented 9 years ago

Yes, Zed would actually behave as a NeoVim plugin; however, a NVim plugin has a lot of freedom, and GUIs in fact can embed it. A NVim "plugin" can intercept and dispatch any vim events that it may want to handle - even custom ones, execute arbitrary vimscript code and generally it can modify the editor's state easilly. This means that Zed would still have complete control over its nvim editor backend, and it would simply need to send events to NVim to notify it to write the file to disk, or open another file, etc.

Zed would simply have to start a NVim instance and then communicate with it through e.g. a named pipe

zefhemel commented 9 years ago

So here's what I don't understand -- presumably this would run Neovim in some sort of headless mode, right? You woulnd't see the neovim UI, but use Zed to interact with it? So basically every key press is then forwarded to the neovim process? Does Neovim have the ability to send back the current screen state? I don't see that anywhere.

Either way, this would be a pretty massive undertaking just to get better vim support :wink:

UberLambda commented 9 years ago

You can get each of neovim's buffers separately through the Api and then render it as you like. But yeah, if the core wasn't meant to support multiple backends, there would be alot to be rewritten... I've posted this since someone mentioned easymotion support - that would be native through NeoVim - and because I think Zed could be a very nice, zero-distractions UI on top of Vim

zefhemel commented 9 years ago

Isn't vim pretty zero-distraction already?

UberLambda commented 9 years ago

Yes, but the problem is that it's interface is text-based. While it's useful for SSH, the lack of a real GUI prevents the creation of some plugins that require one (like the markdown preview inside the editor) without resorting to external programs, while Zed+vim would allow it. Il 27/feb/2015 16:26 "Zef Hemel" notifications@github.com ha scritto:

Isn't vim pretty zero-distraction already?

— Reply to this email directly or view it on GitHub https://github.com/zedapp/zed/issues/511#issuecomment-76411530.