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.

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
add comment

1 Answer

up vote 2 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
add comment

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.