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

how to prevent cmd+Q when multiple splits are open?

Expand Messages
  • leob
    Hello all, Is there a way of preventing cmd+Q from closing when there are more than one buffer open via splits? Note that i m not asking about tab s. Thanks in
    Message 1 of 6 , Sep 10, 2013
    View Source
    • 0 Attachment
      Hello all,

      Is there a way of preventing cmd+Q from closing when there are more than one buffer open via splits? Note that i'm not asking about tab's.

      Thanks in advance

      Leo

      --
      --
      You received this message from the "vim_mac" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php

      ---
      You received this message because you are subscribed to the Google Groups "vim_mac" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_mac+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Tony Mechelynck
      ... I m not on the Mac so (part of) what I m saying below might not apply to you. AFAIK, Ctrl-Q (on Linux and Windows, at least, where ther e is no Cmd key)
      Message 2 of 6 , Sep 11, 2013
      View Source
      • 0 Attachment
        On Tuesday, September 10, 2013 3:18:55 PM UTC+2, leob wrote:
        > Hello all,
        >
        > Is there a way of preventing cmd+Q from closing when there are more than one buffer open via splits? Note that i'm not asking about tab's.
        >
        > Thanks in advance
        >
        > Leo

        I'm not on the Mac so (part of) what I'm saying below might not apply to you.

        AFAIK, Ctrl-Q (on Linux and Windows, at least, where ther'e is no Cmd key) closes nothing; it is an alternative to Ctrl-V (which, in Normal mode, starts block-visual, and, in Insert-mode, start "literal" character insertion.

        The command to close a split-window is normally :q (but it also closes the current tab if there is only one window in it, and the whole of Vim -hidden unsaved buffers mermitting- if there are no nonhelp windows apart from the current one). You could also use :close (q.v.) which will never quit Vim.

        Is there a mapping for Cmd-Q on your installation on Vim? Try

        :verbose map <D-Q>
        :verbose map! <D-Q>

        (both with and without the exclamation mark).

        Or if you are on MacVim there might be something of which I'm totally unaware in the MacVim customizations (the sources added to plain-vanilla Vim to give it a non-X11 GUI on the Mac).


        Best regards,
        Tony.
        --
        He keeps differentiating, flying off on a tangent.

        --
        --
        You received this message from the "vim_mac" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php

        ---
        You received this message because you are subscribed to the Google Groups "vim_mac" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_mac+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • Douglas Drumond
        ​Hi Tony,​ 2013/9/11 Tony Mechelynck ... ⌘Q é o atalho padrão para fechar aplicativos no Mac. -- Douglas Drumond *GDG
        Message 3 of 6 , Sep 11, 2013
        View Source
        • 0 Attachment
          ​Hi Tony,​

          2013/9/11 Tony Mechelynck <antoine.mechelynck@...>
          I'm not on the Mac so (part of) what I'm saying below might not apply to you.

          ⌘Q é o atalho padrão para fechar aplicativos no Mac.


          --
          --
          You received this message from the "vim_mac" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php
           
          ---
          You received this message because you are subscribed to the Google Groups "vim_mac" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_mac+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.
        • björn
          ... You could write a Vim function that conditioned on how many splits there are either does nothing, or calls :macaction terminate: . Then bind this to
          Message 4 of 6 , Oct 12, 2013
          View Source
          • 0 Attachment
            On Tue, Sep 10, 2013 at 3:18 PM, leob wrote:
            >
            > Is there a way of preventing cmd+Q from closing when there are more than one buffer open via splits? Note that i'm not asking about tab's.

            You could write a Vim function that conditioned on how many splits
            there are either does nothing, or calls ":macaction terminate:". Then
            bind this to <D-q>. Since Cmd+Q is already bound to a menu item
            you'll have to unbind it first, see ":h cmd-key".

            Oh, no. Actually this won't work. Since the Quit item is under the
            special "MacVim" menu there is no way to undbind Cmd+Q. You could
            bind the above to some other key though (Cmd+Shift+Q? Ctrl+Q?).

            Other than that you'd have to edit the source code, but getting the
            number of open splits from Vim inside the MacVim process is probably
            going to be a bit tricky.

            Björn

            --
            --
            You received this message from the "vim_mac" maillist.
            Do not top-post! Type your reply below the text you are replying to.
            For more information, visit http://www.vim.org/maillist.php

            ---
            You received this message because you are subscribed to the Google Groups "vim_mac" group.
            To unsubscribe from this group and stop receiving emails from it, send an email to vim_mac+unsubscribe@....
            For more options, visit https://groups.google.com/groups/opt_out.
          • Bee
            It is possible to use System Preferences to add or change Keyboard Shortcuts for any Mac App. The following may be slightly different for versions of MacOS.
            Message 5 of 6 , Oct 12, 2013
            View Source
            • 0 Attachment
              It is possible to use System Preferences to add or change Keyboard Shortcuts for any Mac App. The following may be slightly different for versions of MacOS.

              Apple Menu
              System Preferences
              Keyboard & Mouse
              Keyboard Shortcuts
              +
              Application: Other (find MacVim)
              Menu Title: Quit MacVim
              Keyboard Shortcut: command option quit

              You might also want to map <D-q>

              Bill

              --
              --
              You received this message from the "vim_mac" maillist.
              Do not top-post! Type your reply below the text you are replying to.
              For more information, visit http://www.vim.org/maillist.php

              ---
              You received this message because you are subscribed to the Google Groups "vim_mac" group.
              To unsubscribe from this group and stop receiving emails from it, send an email to vim_mac+unsubscribe@....
              For more options, visit https://groups.google.com/groups/opt_out.
            • Douglas Drumond
              2013/9/12 Douglas Drumond ... ​ With this thread revived, I saw I wrote in Portuguese, sorry. It s irrelevant now, but for
              Message 6 of 6 , Oct 12, 2013
              View Source
              • 0 Attachment

                2013/9/12 Douglas Drumond <drumond.douglas@...>
                ⌘Q é o atalho padrão para fechar aplicativos no Mac.
                With this thread revived, I saw I wrote in Portuguese, sorry. It's irrelevant now, but for completeness, I answered that ​⌘Q is the standard shortcut to close applications in Mac OS (due to comparison with Windows/Linux counterpart before).


                --
                Douglas Drumond

                --
                --
                You received this message from the "vim_mac" maillist.
                Do not top-post! Type your reply below the text you are replying to.
                For more information, visit http://www.vim.org/maillist.php
                 
                ---
                You received this message because you are subscribed to the Google Groups "vim_mac" group.
                To unsubscribe from this group and stop receiving emails from it, send an email to vim_mac+unsubscribe@....
                For more options, visit https://groups.google.com/groups/opt_out.
              Your message has been successfully submitted and would be delivered to recipients shortly.