1

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.

3

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.

  • :!open -a MacVim filename worked fabulously. The only problem is you can't open the same file this way, but that's not a huge problem. :!open -a MacVim % doesn't work. Overall I can work around that by just opening up the current directory with :!open -a MacVim .. My workflow is to open a new window and then ctrl-p to the new file I'm looking for – CornSmith Jun 16 '17 at 4:42
  • A week or so later and I'm really not happy with this workflow :p I'd really like to be able to open up files with params like line number but open doesn't support args (try it, nothing works, I know the docs say it should work with --args) – CornSmith Jun 28 '17 at 19:19
  • @CornSmith There's a "mvim" script inside the app bundle that you can copy or link into /usr/local/bin to allow it to be opened from the command line. But i'm not sure how you're able to open it from the terminal already but not from within vim, check what $PATH is. – Random832 Jun 28 '17 at 19:49
  • I mean, it's in the $PATH since if I type :!gvim something it doesn't error, it just doesn't do anything. Same with mvim. It's like gvim is somehow making it impossible to spawn more gvim windows from itself. – CornSmith Jun 28 '17 at 21:20
  • @CornSmith Weird. It works for me. – Random832 Jun 29 '17 at 4:01
0

I was able to finally solve it (hackily) by launching it from another python process. The problem is something to do with one macvim instance not releasing python properly.

https://vi.stackexchange.com/a/12792/12803

I know it's usually bad form to post a link as an answer, but since it's another stackexachange link I'm not sure

You must log in to answer this question.

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