I think you should be able to do
/Applications/MacVim.app/Contents/MacOS/Vim -f "$1"
or similar, using the mvim script included with MacVim. It will open a Vim
instance (MacVim window) but remain in the foreground (block) until that window is
closed (and thus the corresponding Vim instance exits).
> Ideally, I would like the call to open the file in a buffer in a new
> tab in an existing window of MacVim, and to return once I've deleted
> the buffer. Should this be done with the remote client/server
> functionality?
The --remote-tab-wait Vim option is for precisely this, I believe, so something like
/Applications/MacVim.app/Contents/MacOS/Vim --remote-tab-wait "$1"
or with the mvim script.
See :help --remote-tab-wait
Ben.
Yes, unfortunately, you are. mutt (and many other Unix-y programs that support
an external editor) need the editor to not exit until the edit is done. For
example, I use mutt and vim to process my mail, and I have gvim wrapped in a
shell script called gvimf, that just does a 'gvim -f "$@"' so that it will stick
around until I am done, then return the edited file to mutt to send.
--
Timothy Knox <mailto:t...@thelbane.com>
The one thing I've learned about freedom of expression is that you really
ought to keep that sort of thing to yourself.
-- Scott Adams, _I'm Not Anti-Business, I'm Anti-Idiot_
set editor ="mvim -f"
should work, shouldn't it? At least `export EDITOR="mvim -f"` works
for git and svn.
Nico
Yes, I think so. Or
editor="mvim --remote-tab-wait"
I wonder where my earlier post that suggested those two things went.
Ben.
except that after writing the file and closing MacVim, I had to switch back to the terminal to get back to mutt.
In the current MacVim version 7.3.390 (and maybe for much longer) the solution is found in "help: hints":
mvim -f -c "au VimLeave * maca hide:
Works like a charm. When I start to compose in Mutt, MacVim opens, and when I finish the focus returns to mutt automatically.