Mac – Open a MacVim (gvim) window from MacVim

macvimvi

On Ubuntu/Windows when I have a gvim window open I just type :!gvim filename to open a new window.

On OSX this does nothing.

I think it may have to do with OSX not liking multiple instances of the same program, but it lets me open all the gvim windows I want manually from terminal.

Best Answer

Using :!mvim filename (or !gvim filename) works for me, but I have the commands set up in /usr/local/bin (and /usr/local/bin in PATH), and I don't remember the installation instructions for where to get the script to put there. If you don't have that, try :!open -a MacVim filename, but this only works on existing files.

Also you can open a new window with ⌘N or :macaction newWindow:, but that won't let you specify a filename, and the working directory will be your home directory.