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

I frequently use the command:

mvim -p file1 file2

to open multiple files in one window as tabs. However it often happens that I subsequently want to open another file from the command line. How do I tell mvim to open it as a new tab in the existing open window?

share|improve this question
up vote 4 down vote accepted
$ mvim --remote-tab file3

MacVim first window is a Vim instance with --servername set to VIM. Each subsequent instance is named VIM1, VIM2 and so on. The command above opens a new tab in the first instance by default, it's the equivalent of:

$ mvim --servername VIM --remote-tab .profile

If you want to open a tab in a specific instance, check its name at the top of the window. Assuming it's VIM1, do:

$ mvim --servername VIM1 --remote-tab .profile
share|improve this answer
Great, thanks a lot! – Pim Schellart Apr 8 '12 at 8:38

You must log in to answer this question.

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