1

I read somewhere that you can use a socket do clientserver functionality but I can't figure out where the socket is.

Is it a file socket in the file system like mysql used to use?

Is it a tcp socket?

I don't see it mentioned anywhere in the remote.txt help file.

The reason I ask is that I'm using WSL2 and I can't seem to get a list of servers with vim --serverlist even though I have a Vim server running.

3
  • Does it maybe involve netrw- ?
    – leeand00
    Mar 6 at 22:54
  • It seems like nvim has the ability to do this, but requires an API be used to drive.
    – leeand00
    Mar 6 at 23:34
  • Do you have still something open in your question? How can we help you further? Mar 12 at 18:57

1 Answer 1

1

For the --serverlist functionality to work you need to have a version of Vim compiled with the clientserver functionality.

You can check if your version has been compiled with that functionality using the Vim command: :version

Remark: I have installed WSL2 with the default Ubuntu distribution and the clientserver functionality is not present. I fear you have the same problem.

With this you could:

  • Start Vim as a server with the following bash command:
vim --servername "VIM"
  • Query the server name associated to an instance (e.g. VIM or VIM1 or GVIM) with the following Vim command:
:echo v:servername
  • Send some keys to another instance with the following bash command:
vim --servername "VIM" --remote-send "iHello World!<Esc>"
3
  • 1
    But I have the Gtk3 version installed and it has +clientserver; I checked: askubuntu.com/questions/1378830/…
    – leeand00
    Mar 7 at 11:48
  • Maybe you could try the experiment I propose in my answer and let us know what are the intermediate result (I noticed that vim --server-list show me the list of server only for 1 second) Mar 7 at 12:04
  • 1
    I noticed that on Linux if no server name is given the server is not started. I have adapted the answer accordingly. Mar 7 at 12:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.