Collaborative editing
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:
- Gobby: homepage Documentation Internals Protocol AnnotedObbySession
- Kobby: blog entry GSoC libinfinitymm libinfinity
- Ebby: Obby with Emacs Elipse
- Gedit plugin for collaborative editing in a Telepathy text muc channel: Collaborate
- Eclipse: link linuxfr (”Eclipse Communication Framework” qui permet (entre autre) de se connecter à IRC, Jabber et beaucoup d’autres IM directement depuis Eclipse. L’intérêt est - par exemple - de pouvoir éditer le même code simultanément à 2 personnes via Jabber.) DocShare_Plugin RT_Shared_Editing Slides NetBeans Collaboration Project Cola
- Microsoft Office Live
- UNA
- Anjuta with gvim: GSoC vim-communication anjuta-gvim-preview
- Abiword with the plugin Collab
- Emacs: Tollef Fog Heen’s blog - D-Bus in Emacs
- Gedit: branch for more D-Bus support
Web 2.0 editors:
- Mobwrite: homepage testing page
- XML Sync Islands: blog entry
Vim: some interesting links:
- Clewn: gvim and GDB
- Some links about asynchronous socket support in vim:
- Mailing list thread about collaborative editing
- Another thread and a third
- vimsh (Vim shell)
[…] 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
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
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
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
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
[…] 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
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
[…] 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
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
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