129

I want to unset the Cmd+M shortcut but I can't seem to find it. I've checked System Preferences > Keyboard > Shortcuts but no luck there. I've even tried running defaults write -g NSUserKeyEquivalents -dict-add 'Minimize' '\0' to no avail.

Chance
  • 1,393
  • 9
    I totally hate this useless shorcut – Nikos Dec 29 '21 at 12:32
  • Did you maybe not restart before checking that defaults write -g NSUserKeyEquivalents -dict-add 'Minimize' '\0' doesn't work? It did the job for me and worked just fine out of the box (after applications were restarted). – Cornelius Roemer Jan 26 '23 at 14:16

8 Answers8

152

You don't need to install any additional software.

  1. Go to System Preferences > Keyboard > Shortcuts > App Shortcuts

  2. Click the Plus Button button below

  3. Enter "Minimize" (use "Minimize All" to override minimizing all windows with ⌥⌘M) into the Menu Title text input field.

  4. Assign some bizzare key combination that you won't press by accident.

  5. Repeat steps three and four for "Minimise" (alternate spelling) which is required for some apps.

  6. Close the window to save the changes.

Keyboard Shortcuts Settings

I'm aware that this is not really "disabling it" but the result is effectively the same and without depending on 3rd party software.

Tamlyn
  • 146
Michal Mau
  • 1,634
  • 8
    This didn't work for me on El Capitan 10.11.2. "Minimize" shows up under "All Applications" in the Keyboard Shortcuts list, assigned to Control-Option-Command-M, but that key combination doesn't minimize, and Command-M still does. – Alex Coventry Jan 20 '16 at 19:36
  • Can I suggest that you add to this response an over ride for the "Minimize All" command. – AKnox Oct 25 '16 at 12:39
  • This doesn't work on High Sierra. – weberc2 Apr 13 '18 at 18:04
  • 1
    Worked for me on High Sierra. – certainlyakey May 16 '18 at 20:35
  • 4
    Yayyyy! Thank you. This is a constant annoyance as it always happens when I accidentally hit Command+M, and I NEVER want to do it on purpose. I finally decided to take a few moments to Google a solution, and yours fixed the issue. – Chris Burbridge Sep 20 '18 at 14:23
  • Regretfully, it's not working for me in Firefox (v62, Sep 2019). I see the menu option says "Minimize" with the crazy key combination I have assigned, but cmd-M still triggers it. Strange and unfortunate. – Eric Sep 24 '18 at 09:01
  • Works for me on High Sierra. It will not minimize Chrome anyway, which is what I care about. – Harlan T Wood Oct 01 '18 at 09:33
  • 1
    Brilliant - worked as opt+cmd+M is a Word shortcut to show paragraph properties. Note that this "setting" doesn't migrate when using Migration Assistant -- just been caught out when migrating to a new Mac using a time-machine backup (and moving from Mavericks to Catalina). – GlennG Nov 27 '19 at 09:33
  • 2
    THANK YOU! Worked on Monterey 12.1. any way to tip you for the end of this annoyance? would love to leave you a tip... – Mike Jan 29 '22 at 15:40
  • Doesn't work for some applications. Its a shame that I can't find the list of all Shortcuts / Commands on mac – Codious-JR Mar 31 '22 at 06:31
  • 3
    this does work for me on Monterey, but as I'm in the uk locale, the menu item was "Minimise" with an s. if others have problems with this, make sure the spelling is correct for your locale – stevel Apr 21 '22 at 12:48
  • 4
    such a dumb feature by apple – SuperUberDuper Jul 21 '22 at 14:03
  • no luck for me on MC, works on brave though, not other apps – SuperUberDuper Jul 21 '22 at 14:03
  • To get this to work in Evernote, where the Minimize All shortcut has caused me a lot of grief, I had to add new shortcuts for the command in both my system language (which Evernote doesn't support) and in English (which Evernote uses). – Nagel Nov 15 '22 at 10:17
  • If you' have non-English user account on your macbook, you need to set all shortcuts for "Minimize" and "Minimize All". You can find them with Chrome:
    1. Open Chrome (actually, almost every app can be used)
    2. Click the tab "Window" on top status bar. Usually It's the second tab from the right.
    3. Get localized name for "Minimize" and "Minimize All".
    4. Override those command with method of the original answer.
    – Roeniss Aug 28 '23 at 12:03
15

Alternative Solution

I tried to follow setting my own shortcut like Machal has suggested. However it didn't work for me and just doubled the keybinding for minimize.

I did find, that setting something else to CMD+M worked perfectly:

enter image description here

Harry
  • 609
13

macOS 10.12 (Sierra):

The accepted answer didn't work for me. But setting the CMD-M mapping to a different action worked right away:

  1. Go to System Preferences > Keyboard > Shortcuts > App Shortcuts

  2. Check off the Show Help Menu item and

  3. assign it a CMD-M key combination.

Keyboard Shortcuts Settings

Not a perfect solution, but still much better than minimizing the window accidentally.

Vojtech Vitek
  • 231
  • 2
  • 4
8

macOS 13.2 (Ventura):

  1. Go to System Settings... > Keyboard > Keyboard Shortcuts... > App Shortcuts

  2. Add all following shortcuts with different bindings under All Applications (use small + button under bindings table):

    • Minimise = Cmd + Ctrl + Opt + Shift + 9
    • Minimize = Cmd + Ctrl + Opt + Shift + 8
    • Minimise All = Cmd + Ctrl + Opt + Shift + 7
    • Minimize All = Cmd + Ctrl + Opt + Shift + 6
    • <Your Localised Names for these commands> = Cmd + Ctrl + Opt + Shift + 5, 4, ...
  3. Switch from System Settings... to any other application (Cmd + Tab)

  4. Go to Menu bar > Window > check new shortcuts are in effect

Profit!

macOS 12.5 (Monterey):

  1. Go to System Preferences > Keyboard > Shortcuts > App Shortcuts

  2. Add all following shortcuts with different bindings under All Applications:

    • Minimise = Cmd + Ctrl + Opt + Shift + 9
    • Minimize = Cmd + Ctrl + Opt + Shift + 8
    • Minimise All = Cmd + Ctrl + Opt + Shift + 7
    • Minimize All = Cmd + Ctrl + Opt + Shift + 6
    • <Your Localised Names for these commands> = Cmd + Ctrl + Opt + Shift + 5, 4, ...
  3. Switch from System Preferences to any other application (Cmd + Tab)

  4. Go to Menu bar > Window > check new shortcuts are in effect

Profit!

macOS 10.16 (Catalina):

  1. Go to System Preferences > Keyboard > Shortcuts > Accessibility

  2. Enable Invert colors shortcut

  3. Assign Command + M combination

  4. Disable Invert colors shortcut

Profit!

ursa
  • 227
4

In 2023 on macOS 13.2, the answer suggested here: https://apple.stackexchange.com/a/73957/330523 worked perfectly - and it's much easier to script so that you don't loose the setting if you move to a new machine:

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

Remember that the change only applies to applications that have been reopened (or after system restart). Maybe that is why it didn't work for you?

Cornelius Roemer
  • 260
  • 1
  • 11
  • 2
    It seems some applications do not honour it, such as Firefox – Ciprian Tomoiagă Mar 08 '23 at 14:08
  • 1
    @CiprianTomoiagă you are right - now that you mention it, it doesn't work on quite a few application either. Maybe I never tested it enough? Strange. – Cornelius Roemer Mar 08 '23 at 15:30
  • Remember to also register Minimise (British spelling). Also some apps (e.g. IntelliJ) have their own keyboard shortcut handling which also needs configuring. Such a mess. – Tamlyn Oct 16 '23 at 09:11
3

Using Karabiner, this works with High Sierra and higher.

Make a file something like this in ~/.config/karabiner/assets/complex_modifications/emacs_shortcuts.json

{
  "title": "Emacs",
  "rules": [
    {
      "description": "Emacs Shortcuts",
      "manipulators": [
        {
          "from": {
            "key_code": "m",
            "modifiers": { "mandatory": ["command"] }
          },
          "to": [{
            "key_code": "m",
            "modifiers": ["left_command", "left_shift", "left_control"]
          }],
          "type": "basic"
        }
      ]
    }
  ]
}

Then go to Karabiner and activate it.

1

The easiest way to do this is to install a key remapper (I use KeyRemap4MacBook). Though the name seems to suggest otherwise, currently KeyRemap4MacBook actually works with all Apple computer products that can run OS X 10.4 or later, including iMac, Mac mini, and Mac Pro.

Using this method, you can map ⌘M, which OS X maps to the minimize function by default, to Fn+⌘M, which is significantly harder to accidentally press, and which OS X maps to no functionality by default.

In other words, you can swap the functionality of these two key combinations so that ⌘M no longer has a functionality and is essentially disabled. While it is not strictly "disabling" the shortcut, this workaround achieves the same effect.

Use the following steps to disable the minimize shortcut in Mavericks:

1. Install KeyRemap4MacBook

Download the appropriate .DMG file from the link above and double click it. If you get a message like this:

Your security preferences allow installation of only apps from the Mac App Store and identified developers

Then open the System Preferences program already installed on your computer and, under the Personal tab, select Security & Privacy. Next, under the General tab, click the lock in the lower left corner to make changes (provide an administrative password if needed), and under Allow applications downloaded from: label, select the Anywhere radio button.

Now you can install the application; you may need to restart once it's finished.

2. Configuring the custom settings

While KeyRemap4MacBook offers a diverse collection of useful features, disabling the minimize shortcut is not among them. Instead, it provides a handy XML file that you can modify using their API to achieve almost any key remapping you can think of.

Open KeyRemap4MacBook, and navigate to the Misc & Uninstall tab. Under the Custom Setting label, click the Open private.xml button. Make sure the document opens in a plain-text editor such as TextEdit. Once opened, you should see a blank XML file with empty root tags. Replace the entirety of its contents with the following code snippet:

<?xml version="1.0"?>
<root>
    <item>
        <name>Disable Minimize</name>
        <identifier>private.disable_minimize</identifier>
        <autogen>
            __KeyToKey__
            KeyCode::M, ModifierFlag::COMMAND_L,
            KeyCode::M, ModifierFlag::COMMAND_L | ModifierFlag::FN
        </autogen>
        <autogen>
            __KeyToKey__
            KeyCode::M, ModifierFlag::COMMAND_L | ModifierFlag::FN,
            KeyCode::M, ModifierFlag::COMMAND_L
        </autogen>
    </item>
</root>

[Note: The previous code uses the left-most command key. If you are interested in disabling the right-most command key, change each instance of COMMAND_L with COMMAND_R.]

Save the private.xml file. Return to the Change key tab. In the main list, under the remapping label, you should now see a Disable Minimize checkbox.

Check the checkbox, and you should now no longer be able to minimize your windows with the ⌘M shortcut. If you ever need to use the shortcut again, use Fn+⌘M, or simply uncheck the Disable Minimize checkbox.

bunting
  • 241
0

I disabled Mission Control in "System Pref>Shortcuts Tab>Mission Control" by unchecking checkbox Mission Control in the column and then Cmd-M would minimize any app open instead.

So, using "Keyboard Maestro" I creating a "Do Nothing" Group and assigned Cmd-M to "No Action" as in screenshot. Worked like a charm!

nohillside
  • 100,768
Richie
  • 1