akiyosi / goneovim

A GUI frontend for neovim.
MIT License
2.41k stars 63 forks source link

Opening files in Windows with single Goneovim instance #533

Open ashrasmun opened 7 months ago

ashrasmun commented 7 months ago

Hello,

As a user, I would like to have only one instance on Goneovim opened at all times and be able to open files by default in that one instance without the need to circumvent it with scripts. GVim had a switch, I recon it was --remote, that enabled that functionality, but I've never seen it in Neovim.

Visual Code opens files like that.

tfriedel commented 3 months ago

I tried this, which works in regular neovim: --- snip start --- To open files in an existing instance of neovim, you can use the --remote or --remote-tab options provided by Neovim. You need to ensure that a Neovim server is running. Start the server with a specific server name:

goneovim --wsl -- --listen /tmp/nvimsocket

You can then open files in this instance using:

goneovim --wsl -- --server /tmp/nvimsocket --remote-tab somefile.txt

You'll need to ensure this server instance is always running when you try to open a new file. This setup might require some automation or a startup script.

--- snip end ---

And this kind of works. Unfortunately the second command spawns a new instance with an empty window. The file is however opened in the first instance.

jlanzarotta commented 1 month ago

This would be a fantastic feature. I am not able to use --wsl, so a native solution would be awesome.