Selecting the "Don't Save" button using the keyboard

2

3

In MacVim, when you try to close a window with unsaved changes (by pressing cmdw), a window pops up to confirm, with 3 buttons:

  • Don't Save
  • Cancel
  • Save...

The third one is blue, the others are gray. If I press Enter, that will trigger Save. If I press Escape, that will trigger Cancel.

enter image description here

How to trigger Don't Save using the keyboard? I tried selecting the button by pressing Tab or arrow keys, but none of those seem to work. My workaround is to press Escape to cancel, and close macvim with the vi command :q!. It would be great if I could navigate to the desired button like it's possible in many other applications.

janos

Posted 2016-12-27T07:30:25.023

Reputation: 2 449

Answers

6

The default keyboard command for Don't Save is Cmd ⌘ Backspace ⌫ which was introduced with Lion
Prior to that it was Cmd ⌘ D which some apps will still respect, but not all.

dialog

Ctrl Tab will switch between the options, which can then be actioned by hitting Spacebar , but only if you have All Controls set in System Prefs > Keyboard > Shortcuts

enter image description here enter image description here

Imported from my own answer at https://apple.stackexchange.com/questions/154046/how-to-quit-without-saving-using-just-the-keyboard

Tetsujin

Posted 2016-12-27T07:30:25.023

Reputation: 22 456

2Worked like a charm, and exactly what I needed, nice touch with the All Controls stuff, thanks a lot! – janos – 2016-12-27T09:51:40.383