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

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Leonardo B. Oliveira-2

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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

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

Tony Mechelynck
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

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

Douglas Drumond
​Hi Tony,​

2013/9/11 Tony Mechelynck <[hidden email]>
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

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

Björn Winckler
In reply to this post by Leonardo B. Oliveira-2
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Bee
Reply | Threaded
Open this post in threaded view
|

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

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.

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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

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

Douglas Drumond
In reply to this post by Douglas Drumond

2013/9/12 Douglas Drumond <[hidden email]>
⌘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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.