Loading ...
Sorry, an error occurred while loading the content.

7737Re: Hide MacVim After Last Window Closes

Expand Messages
  • Ben Schmidt
    Jun 2, 2008
    • 0 Attachment
      björn wrote:
      > 2008/6/2 Edwin Shao <poleris@...>:
      >> Is there anyway to hide MacVim after the last window closes or run
      >> some sort of daemon to speed up the load time of MacVim?
      >>
      >> It takes ~2 seconds to load a textfile when MacVim is not running and
      >> ~.2 seconds when MacVim is already up, so I don't want to quit the
      >> application. But at the same time, I would like it out of the way
      >> after I'm done editing the last file. What would be the best way of
      >> achieving this?
      >
      > I'm not sure exactly how you would accomplish this, but sending
      >
      > :maca hide:<CR>
      >
      > after you've finished editing the last file would hide MacVim without
      > closing it. Maybe you could use this inside a mapping or an
      > autocommand or something? Anybody else have any ideas how to do this?

      A good idea, Björn, but it doesn't work, i.e.

      au VimLeave * maca hide:

      has no effect. Neither does

      au VimLeavePre * maca hide:

      Maybe both these autocommands fire after the connection to MacVim is already
      closed. I guess for many autocommands that wouldn't matter, but it definitely
      matters if you want to use :maca! Do you reckon that's changeable?

      At any rate, if you can figure out why the above doesn't work and fix it, then it
      would be easily achieveable with

      au VimLeave * if len(split(serverlist(),"\n"))==1 | maca hide: | endif

      i.e. when the last Vim server is closing, hide MacVim.

      I can't think of any other way to do this at this stage without adding code to do
      so to MacVim. The autocommand solution is nicer IMHO, if the :maca at VimLeave
      time could be addressed.

      Ben.





      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_mac" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Show all 5 messages in this topic