

Floobits-Vim: Real-time collaboration plugin for Vim - ggreer
https://github.com/Floobits/floobits-vim

======
ggreer
Writing this plugin has been quite the learning experience. Vim strives to be
a text editor foremost, and its plugin API discourages terminals or REPLs.
Unfortunately, similar API functionality is needed if one wants to create a
collaboration plugin.

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().

------
pekk
When someone else posted their vim collaborative plugin, the Floobits people
were all over the thread promoting their commercial product over it.

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.

~~~
kansface
I will note that neither ggreer nor myself commented in the other thread (ie,
the Floobits team). For that matter, we don't have any ill will towards CoVim
or the Etherpad Vim plugin; I personally hope they succeed and the number of
people who pair program on a daily basis increases.

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.

------
larrybolt
Well, to add my 5 cents, Floobits works great!

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!

------
tomsthumb
Screen and tmux both have shared sessions, and even though screen isn't really
under active development anymore it is solid.

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.

~~~
kansface
We also have a shared shell which uses Floobits permissions called flootty:
<https://github.com/Floobits/flootty>.

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.

------
kansface
ggreer and I have been working on adding vim to floobits for a few months now.
Presently, we support communication between Sublime, Vim, and our web editor.
We are working on Emacs right now and I expect it will be ready for an alpha
release in about a week.

------
shapeshed
I haven't seen anything to compete with tmux and wemux
<https://github.com/zolrath/wemux>. It works great!

------
suman_nandan
This is good. But how does it any better than a Vim over a tmux session?

------
icholy
this is sweet!

