vhakulinen / gnvim

GUI for neovim, without any web bloat
MIT License
1.86k stars 68 forks source link

Add `--server` option to connect to specific nvim session? #4

Open shaform opened 5 years ago

shaform commented 5 years ago

nvim-qt has an option to attach to existing nvim sessions: https://github.com/equalsraf/neovim-qt/wiki/Remote-attachment

This enables us to use nvim-qt to attach to nvim running on remote servers via ssh, which is really useful. In this way, we are no longer being restricted to work on text-based terminals when connecting to remote servers.

I've inspected several other GUI alternatives for neovim, but it seems that nvim-qt is the only one that supports this currently. However, I don't quite like the current UI interfarce of nvim-qt.

I am wondering if gnvim would supports this? This would be really helpful since I am required to work on remote machines most of the time.

Thanks!

vhakulinen commented 5 years ago

This is something that can be implemented and neovim-lib (the library gnvim is using to communicate with nvim) even shows how to do it on its first documentation page: https://docs.rs/neovim-lib/0.5.4/neovim_lib/#examples.

shaform commented 5 years ago

That's good news! But one thing to notice is that as more features are added, full support for remote mode would become more complicated. See https://github.com/daa84/neovim-gtk/issues/21.

vhakulinen commented 5 years ago

Those are good points. Only problem we're facing is the runtime files, which applies for neovim-gtk too. If we ever decide to implement a GUI file browser for example, it shouldn't bypass nvim.

For runtime files, we could read the runtime file(s) (at least the essential ones) on startup and inject them to nvim before attaching the UI.

smolck commented 5 years ago

Once this Neovim PR is merged, would GNvim be able to connect to a remote session via gnvim -- --connect <host>:<port>?

EDIT: Fixed example command