Networked Collaboration

Kakoune, with its separate client-server design seems like it would lend itself well to a networked/remote collaboration setup, like VSCode’s Live Share: where multiple clients, on different machines, could edit the same buffer over the network.
Does anyone know if something like this has been explored yet?

Indeed, I’ve tried it and it’s in my todo list solving the problems that arised.

I remember some of them were:

  • Separating the clipboard management for different clients (and registers in general). It is very annoying pasting something and realizing that it’s not what you yanked.
  • Showing other client’s (partners’) selections.
  • Allowing different buffers for tools such as make.
  • Allowing different mappings.
  • And more importantly: managing permissions. Using different users or restricting commands to some users.

I generally have used tmux for this purpose. I think VSCode is dominant enough now that if someone was to build a feature like this – it should be compatible with VSCode.

1 Like

Agree, it’s not likely that the whole team is using kakoune :slight_smile: hopefully one day !
But I wonder how hard would be to implement such a feature

Maybe it would be possible to pull off something where open buffers, buffer edits and cursor positions are synchronized across different clients by some intermediate program that acts as a proxy/multiplexer between a VSCode/NVim/Kak server and matching VSCode/NVim/Kak clients. But my guess would be anything beyond that would be extremely difficult if not impossible, even simple integration may be very difficult if certain features are client side only.

I generally have used tmux for this purpose.

How do you use tmux for this?

Just brainstorming, but could using a lightweight http server to serve messages to/from Kakoune’s JSON RPC be a viable method?

For VSCode compatibility, maybe kakoune-mode could provide some insight.

… something where open buffers, buffer edits and cursor positions are synchronized … a proxy/multiplexer between … VSCode/NVim/Kak clients

That is an interesting idea. Basically, a program that acts as a router for basic editing concepts, and is agnostic to the details of any specific editor, right? Something like that might be compatible with any editor with a JSON RPC interface.

Kakoune clients connect to the server through a Unix domain socket. If you change the permissions on that socket, you can allow multiple people on the same server to connect to it and edit the same buffer at the same time, just like you can run :new to get a second client editing the same buffer.

You can also use SSH port forwarding to run a Kakoune client locally and connect to the server on a remote system, although setting up permissions/authentication is left as an exercise to the reader.

3 Likes

Is this a mathematics book? :joy:

I do it manually – by letting someone connect to my IP over ssh and then connect to my tmux session. https://www.howtoforge.com/sharing-terminal-sessions-with-tmux-and-screen

There is an easier way: https://tmate.io/ – which I generally don’t use because I am stuck in my ways.

No server, just you and you or you and colleagues (but middleman want’s all your data! :rage:).

Syncthing website or Syncthing github is a continuous file synchronisation program.

I’ll put up extended details on the thread ‘Terminal Life - Lust for Life’ for everyone.

I decided to start implementing the things I missed the most. You can check my new plugin multiuser.kak.

Right now it only serves to show the other users selections (thanks @occivink for kakoune-phantom-selections) and jumping to them, but it should be easy to reuse the framework to implement mappings that allow storing the yank register in an option that is different for each user, which right now is the biggest pain point for me. I think I will do it myself when I find time again.

1 Like