Alban’s blog

September 21, 2008

Collaborative editing

Filed under: Uncategorized — alban @ 9:34 pm

The screencast

Screencast with gedit and gvim

Screencast witg Emacs, gedit and gvim

The code

Plugin for gvim:
git clone http://people.collabora.co.uk/~alban/git/vim-remotecontrol/

Plugin for gedit:
git clone http://people.collabora.co.uk/~alban/git/gedit-remotecontrol/

Plugin for Emacs:
wget http://alban.apinc.org/files/collaborative-editing/collabora.el

Daemon which joins the buffer of theses editors:
git clone http://people.collabora.co.uk/~alban/git/text-remote-control/

Each editor exports their buffers as D-Bus objects with the following interface:

  • D-Bus signal TextInserted(u: loc, s: text, u: len)
  • D-Bus signal RangeDeleted(u: start, u: end)
  • D-Bus method InsertText(u: loc, s: text, u: len)
  • D-Bus method DeleteRange(u: start, u: end)

When the daemon receives the signals TextInserted or RangeDeleted from the vim or gedit’s buffer object, it calls InsertText() or DeleteRange() on the other buffer objects.

Editors also export a browser object on D-Bus with a single method ListBuffers() -> as: buffer_list. So the daemon can know the available buffers on the bus. The daemon currently use all buffers it finds on the bus and join them in a single collaborative session.

Next steps:

  • It works when all editors are on the same computer, but it is not very useful. The daemon should use a Telepathy tube with the Obby protocol.
  • An UI to create a collaborative session, put editors’ buffer in the collaborative session, create a Telepathy tube to communicate with contacts.
  • The vim plugin works only with gvim and not the console version because the D-Bus’ socket is not integrated in the vim’s mainloop.
  • The cursor position in gvim is not stable when another editor write a change in the buffer.

Other random links about collaborative editing and vim

Real editors:

Web 2.0 editors:

Vim: some interesting links:

10 Comments »

  1. […] The code used to make the screencast is on my collaborative editing page. […]

    Pingback by Alban’s blog » gvim and gedit together — September 21, 2008 @ 10:02 pm

  2. UI for making connection should be the IM contacts list. That way you don’t have to mess around with IP addresses and ports.
    Ultimate use-case: Drag an IM contact from the contacts rooster to the editor to initiate a shared editing session.

    Comment by Sebastian Bengtsson — September 23, 2008 @ 2:53 pm

  3. I would like to use Telepathy Tubes, so the UI does not have to mess around with IP addresses, ports, NAT traversals etc. Yes, the drag and drop use case would be great.

    Comment by admin — September 24, 2008 @ 12:05 am

  4. Tubes, yes definitely. But should it be xml-wrapped over the IM net or just be used to initiate contact? An in-band tube as I understand it might remove the need for uPNP etc. But it also depends on how much lag the IM-net would introduce.
    I am also a big fan of the concept of people as first-class objects, that is starting to emerge in apps like soylent and gimmie.

    Comment by Sebastian Bengtsson — September 24, 2008 @ 11:16 pm

  5. That would be great to use vim replacing gobby for projects.
    Nice idea! Thanks for developing this plugin.

    I’m so impatient… :)

    Comment by ws — October 7, 2008 @ 6:04 pm

  6. […] sent me a collaborative plugin for Emacs. It can work with the gedit and gvim plugins I hosted on my collaborative editing page. It needs D-Bus support in Emacs, so the version 23.0.60 at least is […]

    Pingback by Alban’s blog » Collaborative editing in Emacs — October 29, 2008 @ 12:11 am

  7. How come “This is gedit.” is missing the “i” in Emacs? “This is gedt.” … a bug?

    Otherwise: really neat!

    Comment by Taneli — October 30, 2008 @ 7:44 pm

  8. […] http://alban.apinc.org/blog/collaborative-editing/ : le travail collaboratif dans Emacs, Vim et gedit. […]

    Pingback by Dev Blog AF83 » Blog Archive » Veille technologique : OpenID, PHP 5.3, CouchDb, Y!OS — November 3, 2008 @ 7:44 pm

  9. This is best thing I’ve seen in last time. I use gvim daily and this feature will make it even better, faster, stronger. Telepathy tubes ultimately, and that cursor issue

    Comment by Dusan — November 21, 2008 @ 10:46 am

  10. This is great. I wrote the original obby support for Emacs, but being able to tie directly into libobby in an external process would be great.

    I’ve also experimented with an alternate git-based approach to collaborative editing: http://technomancy.us/113

    Comment by Phil — December 3, 2008 @ 6:32 am

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress