Disable Command-M to minimize window

keyboardminimize

On my keyboard layout, the M key is right next to the W key:

Dvorak keyboard with adjacent m and w keys circled

This can be problematic at times because occasionally I will accidentally press CommandM instead of CommandW, causing the window to be minimized rather than closed.

Since there's no keyboard shortcut to un-minimize a window (well ok, no easy keyboard shortcut), this is even more annoying because then I have to switch to my trackpad to un-minimize the window and then try again to close it.

Is there a way to disable the CommandM shortcut for minimizing a window?

Best Answer

You can disable it by editing ~/Library/Preferences/.GlobalPreferences.plist:

defaults write -g NSUserKeyEquivalents -dict-add 'Minimize' '\0'

To apply the changes you have to reopen applications. If the shortcut was assigned to nil, pressing L would trigger it in Audacity.