MacVim opens useless windows when started as a server

30 views
Skip to first unread message

Magnus Henkel

unread,
Apr 17, 2014, 11:14:10 AM4/17/14
to vim...@googlegroups.com
I'm writing a python script which starts MacVim as the editor for a couple of files. These files will be scanned (and copied into other files) while they are open.
The background processing for a certain file stops when it is closed manually.

I'm trying to use the vim server capabilities, since obviously I don't want to fire up the MacVim application several times.

I discovered that there are (at least) two ways of starting MacVim and both are not working correctly for me:
Using the path /Applications/MacVim.app/Contents/MacOS/MacVim from python opens a white window without any content on top of the other window showing the text file. It also starts up the application more than once and it keeps opening white windows when more files are opened.

Using the path /usr/bin/mvim doesn't show this behavior but it makes it more awkward to track the process from python (that might be more python than vim related). Using subprocess.call doesn't wait for the MacVim window of current text file to be closed (as it should and it does with the other path).

The subprocess.Popen records a PID which is not the one of the text file but of some other vim "instance" (maybe it is the server, ps aux only shows "(Vim)" and the text file opened previously gets another PID).

I wonder if these issues are related to how the vim server starts up and if there is a way to deal with the server in a more "clean" way.

I have been posting a question related to the same problem on stackoverflow:

http://stackoverflow.com/questions/23067612/python-cant-get-hold-of-real-process-id-with-subprocess

Björn Winckler

unread,
Apr 21, 2014, 10:54:23 AM4/21/14
to vim...@googlegroups.com
Check out ":h macvim-start".

I *think* what you are looking for is:

/Applications/MacVim.app/Contents/MacOS/Vim -fg

Björn
Reply all
Reply to author
Forward
0 new messages