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?
Best Answer
MacVim first window is a Vim instance with
--servername
set toVIM
. Each subsequent instance is namedVIM1
,VIM2
and so on. The command above opens a new tab in the first instance by default, it's the equivalent of: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: