Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
up vote 8 down vote accepted

Sorry no such feature, found this advice:

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

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

share|improve this answer
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
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 wonder if gobby has vim key bindings though. – 2rs2ts Oct 2 '15 at 16:46

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:

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .