From SubEthaEdit: Editing documents in groups can be a challenge. Versioning systems like cvs or subversion can help your group to keep a consistent copy of your document, but don't go that extra mile. Wouldn't it be great to edit the same document, live, in realtime, together with everyone in your group?
http://www.codingmonkeys.de/subethaedit/screenshots.html
Another functional working collab editor (cross-platform and mostly free)
http://me.sphere.pl/indexen.htm
This topic's parent is HomePage but was originally started as a ChallengeIdeas. This challenge has been updated more than once with partial solutions. The following description is from :he remote.txt
When compiled with the |+clientserver| option, Vim can act as a command server. It accepts messages from a client and executes them. At the same time, Vim can function as a client and send commands to a Vim server.
The original challenge was to find the best interface to "tunnel data into command mode." I feel the real solution is RemoteBuffers? (see RemoteBufferNotes), but that doesn't exist in vim yet. Even once the data transfer problem is resolved, there are other issues that remain unaddressed if the goal is a robust, easy to use implementation.
There are two functions that apply for sending data: remote_send() and remote_expr(). The basic functionality explored here is how to get text data from one buffer to another.
Function remote_send() can be invoked directly from within a vim client or via a shell command line. It acts as if the user were actually typing the keys. Care must be taken to ensure the correct mode is valid when the keys are sent with remote_send. Function remote_expr() will evaluate on the remote vimserver and return the results. To effect a buffer on server GVIM, use commands such as
:call remote_send( GVIM, '<esc><esc>:<command>' )
or
vim --servername GVIM --remote-send '<esc><esc>:<command>'
What this challenge presumes is building a "watchdog" kind of application to keep otherwise separate buffers synchronized. The commands are the most basic ways of moving data from one buffer to another using existing infrastructure. The advantages and disadvantages of using the X protocols are noted. The fundamental concept of separate buffers synchronized via some kind of vimscript application (perhaps using patched vim code) remains.
Proof of concept experiments:
The following commands insert an "x" at line 6 col 20 in the local buffer. The first command uses byte count, the second one uses screen columns. While no autocommand exists yet for single characters in Insert mode, this might be used in the future.
:call setline(6,substitute(getline(6),'.\{20}','&x',''))
or
:let scl = col('.') | let sln = line('.') | let ssrch=@/ | 6s/\%>20v\@=/x/ | call cursor(sln, scl) | let @/ = ssrch
commands that read one buffer on a client machine and make an initially empty buffer contain the same contents.
:call remote_send ( "GVIM", "<esc><esc>" )
:let b:line = escape ( getline(1) , "'\"")
:call remote_send("GVIM", ":call setline(1, \"" . b:line . "\")<cr>" )
:let b:loop = 2 + 0
:while (b:loop < line("$") + 1):let b:line = escape ( getline(b:loop) , "'\"")
:let b:loopminus = b:loop - 1
:call remote_send("GVIM", ":call append(" . b:loopminus . ", \"" . b:line . "\")<cr>" )
:b:loop = b:loop + 1:endwhile
Future Challenges
VimSynchDev RemoteBufferNotes MultiuserSyntaxHighlightTracking MultiuserAdhocNetworking MultiUserNonVim SubEthaEdit ZeroConf DocSynch ChallengeIdeas
A PDF version of a research paper that describes issues that arise when implementing this capability is "Operational Transformation in Real-Time Group Editors: Issues, Algorithms, and Achievements (1998)."
http://citeseer.ist.psu.edu/sun98operational.html
This challenge is inspired by SubEthaEdit (many references moved to that page) for the Macintosh Cocoa platform as well as DocSynch (see for references) for the jEdit editor.