Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

With vim, can two users edit the same file at the same time?

share|improve this question

7 Answers 7

up vote 8 down vote accepted

Sorry no such feature, found this advice:

The common suggestion is to use a shared "GNU Screen" session:

http://groups.google.com/group/vim_use/browse_thread/thread/f502e7783038d484/c4603374d2e752b2

to do collaborative editing in Vim. However, it's a bit tricky because it's modal, so if one person changes modes, the other person has to adapt accordingly.

share|improve this answer

Sorry to dig out this old question but as I bumped on it and found an answer here it is:

Have a try with https://github.com/FredKSchott/CoVim

share|improve this answer
1  
CoVim plugin need twisted as dependency pip install twisted –  juanpablo May 16 '13 at 14:48

I don't think so, because Vim creates a swap file any time you open a file. This swap file helps if you want to recover after some sort of an error. When the second user opens the file, his or her Vim will see the swap file and get an error and the options to ignore, delete, recover, etc. I don't think that both users would be able to simultaneously edit this file.

I think the best way to have both users work on the same file is to use a version control system. I like mercurial (good tutorial here), but subversion and git are the classics.

share|improve this answer
    
Good suggestion about using version control. That solves so many problems in one fell swoop. –  Anthony Giorgio Jan 11 '11 at 22:32
1  
the swap file is not the problem. its just not that each user can see what the others are typing :) –  akira Jan 13 '11 at 14:49

I'm not aware of any vim plugins for collaborative editing, but have a look at gobby.

share|improve this answer

i know it's dirty too but you may use screen for the first terminal then screen -x on the second one and so on when logged into a terminal with the same user from somewhere else

share|improve this answer

vim-multiuser looks interesting. It actually allows users to be in different modes at the same time.

share|improve this answer

Somebody has mentioned something similar on Hackernews. You might want to check it out:

http://news.ycombinator.com/item?id=720764

You might also want to take a look at DocSynch (its peresently available only for JEd, a VIM plugin is supposedly still in development). One dirty hack would be to sync your files over a file storage service like Dropbox.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.