4

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?

1 Answer 1

5
$ 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
0

You must log in to answer this question.

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