vim has a really cool feature that allows you to concurrently edit the same file in a single vim session.

I use the i3 window manager. I like it because it allows me to tile my windows, tab them, float them, or some combination of those, according to the situation, regardless of whether the window is a browser, or a terminal or whatever. My typical work flow so far has been to open vim in a new terminal for each file I'm editing. Opening vim in a single terminal and just using the internal buffer management commands would be very restricting; it would prevent me from using all of my favorite i3 functionality.

So is there a way to concurrently edit a single file in separate terminals with vim? Maybe something using vim's client server functionality...

  • see some discussion on this topic here: stackoverflow.com/questions/7842511/… . Personally my advice is don't. – Frank Thomas Aug 20 '15 at 16:40
  • github.com/FredKSchott/CoVim – FDinoff Aug 21 '15 at 0:37
  • @FDinoff, Oh, yiss. This is even better than what I had in mind. Please post this as an answer so I can accept it. – Overdr0ne Aug 21 '15 at 14:35
  • One Vim... Just One – mMontu Aug 21 '15 at 20:01
  • @mMontu, I'm not saying vim doesn't integrate well with the shell, I'm saying I don't want it managing my windows. I don't need vim's split command when my WM does that better, automatically when I open a new window. I can more easily make my buffers span multiple screens/workspaces in groups, according to my needs. The performance hit of multiple vim sessions is vanishingly small on my machine. If multiple terminals could share a vim session, that would be pretty cool, but those components don't seem to be separated. CoVim gives me all the functionality I want with no noticable drawbacks. – Overdr0ne Aug 21 '15 at 21:08

There is a plugin called CoVim which adds collaborative editing to vim.

CoVim in Action


Also, you could use a terminal multiplexer like tmux and connect multiple clients to a session with vim.

I use i3 in combination with tmux, which offers me lots of possibilites to achieve things like that.

  • But then both of those sessions are identical. My reason to want to do this is that I'm editing a longish script that hasn't (yet) been split up into multiple files and need to edit multiple interacting parts in concert. – Nobody Sep 9 at 11:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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