Floobits-Vim: Real-time collaboration plugin for Vim
github.com
github.com
Matt (kansface) and I have figured out two ways to get this working:
1. Set updatetime to a low value and call feedkeys with a key combo that is effectively a no-op. Then you can have an autocmd for CursorHold that calls select(). Unfortunately, since K_IGNORE was removed from Vim a few years ago, there is no key combo that is truly a no-op. This method breaks some keyboard shortcuts.
2. Start Vim as a server and spawn a subprocess that sleeps for 200ms, then runs another Vim as a client. This client Vim calls a tick function in the server Vim, which select()s and repeats the spawn-a-subprocess trick. This has fewer side-effects but is crazy inefficient.
This would have been so much easier if Vim's plugin API had a setTimeout().
I will also note that the Floobits people seem incapable of posting about their vim plugin without downing vim, as if doing this were equally or more important than their product.
Floobits is also currently free and the plugins at least are open sourced. It takes a significant amount of time to develop this software- hopefully users will find the value we add commensurate with the investment on our part and we can make a business out of it.
Finally, we are left in a strange position with users on why the Vim plugin behaves so strangely. Ideally, users wouldn't have to change their behavior at all; everything would just magically work. Unfortunately, Vim is purposefully designed to make things like collaborative editing impossible (it has no event loop and async actions are impossible). Vim is by design a text editor and not an IDE. We should probably communicate the limitations of the platform better to end users.
When reading the post about CoVim I tried getting it to run, but it gave me ugly errors about my python version which (I really did try to fix) but took a bit more time than expected and I gave up.
When coming to the vim-support, it works great! Even better than in Sublime since in Sublime there is this marking of what has been added the last few seconds which I personally don't like.
Installing was very easy both for vim and sublime, though I had to manually install it for Sublime text and restart (the settings menu was disabled, not sure why).
Also there was no default config so I had to copy/paste from the site and add my username/secret.
Something I'd love to see: The ability to see which user is editing where (using colors, I believe like CoVim does?).
But anyway, great work!
Does this offer anything that other more widely used pieces of software don't already provide (and provide well)?
Edit: Ahhh, I didn't realize from the git page that it would let you use different editors on different ends of the shared session.
Flootty is also accessible from our web based editor which has an embedded pty. Its actually possible to run a vim inside flootty that itself is running floobits.