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

Re: Hide MacVim After Last Window Closes

Expand Messages
  • björn
    ... I m not sure exactly how you would accomplish this, but sending ... after you ve finished editing the last file would hide MacVim without closing it.
    Message 1 of 5 , Jun 2, 2008
    • 0 Attachment
      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?

      Björn

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_mac" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Nico Weber
      Hi, ... what don t you like about hitting ⌘H when you don t need MacVim any more? Nico --~--~---------~--~----~------------~-------~--~----~ You received
      Message 2 of 5 , Jun 2, 2008
      • 0 Attachment
        Hi,

        > 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?

        what don't you like about hitting ⌘H when you don't need MacVim any
        more?

        Nico
        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_mac" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • Ben Schmidt
        ... 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
        Message 3 of 5 , 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
          -~----------~----~----~----~------~----~------~--~---
        • björn
          ... You may be right that the autocommand fires too late ...I will look into it. Björn --~--~---------~--~----~------------~-------~--~----~ You received
          Message 4 of 5 , Jun 3, 2008
          • 0 Attachment
            2008/6/3 Ben Schmidt <mail_ben_schmidt@...>:
            >
            > 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.

            You may be right that the autocommand fires "too late"...I will look into it.

            Björn

            --~--~---------~--~----~------------~-------~--~----~
            You received this message from the "vim_mac" maillist.
            For more information, visit http://www.vim.org/maillist.php
            -~----------~----~----~----~------~----~------~--~---
          Your message has been successfully submitted and would be delivered to recipients shortly.