Mac OSX: Setting a keyboard shortcut for maximize/resize window (green jewel)

Posted by jeremyclarke on March 15, 2010
Filed under General

I’ve been dreaming for a long time of a system-wide keyboard shortcut to maximize/resize the current window in OSX (windows-style, where the window fills the screen or not, rather than going to the dock). In pretty much every application the ‘Window’ menu item has Minimize (shunt to dock) and “Zoom” which resizes the window and has the same effect as the green “+” jewel in the window header. The Minimize item has the easy-to-use keyboard shortcut CMD+, while the Zoom item has no shortcut and no hint at how to get one.

EDIT (Sep 27, 2010): Based on my realizations about Firefox and NetBeans detailed below I now think this method is pretty insufficient for me and probably lots of other people. I have since tried the 13$ SizeUp application recommended by Martin Reisch in the comments. It is excellent and elegant and solves both the problems I had and ones I didn’t realize I had until they were solved. I recommend it whole-heartedly for those among us with big screens and small patience for window management.

divvy logo EDIT (Jan 24, 2012): Another commercial solution to this problem that has appeared is Divvy. I haven’t tried it yet simply because I have SizeUp working and already paid for it, but from what I’ve heard Divvy takes it to the next level by adding a slick graphical interface in addition to keyboard shortcuts, as well as letting you create infinite different resizes, whereas SizeUp limits you to preset ones. Divvy has a demo so you can try it for free.

I looked around and found some totally whacked out solutions involving applescript or bash scripting but finally found an incredibly simple and obvious method using System Prefs. I recommend it for everyone who is sick of using the mouse to hit the tiny green jewel.

Detailed steps to set a Maximize keyboard shortcut in Mac OSX 10.6

  • Launch System Preferences from the Apple menu
  • Go to Keyboard settings
  • Go to Keyboard Shortcuts tab at the top of the window.
  • Go to Application Shortcuts in the sidebar of the window.
  • Click the small + button
  • In the popup thing make sure ‘All Applications’ is selected for Application:
  • In the Menu Title box type in exactly: Zoom
  • In Keyboard Shortcut type in the shortcut. I recommend Command-Shift-M
  • Click Add button.
  • Restart each app you want it to work in.

Screenshot of the system prefs window where you set the keyboard shortcut

Note on restarting apps: These shortcuts work on an app-by-app basis so it will only work in a given application after the app is restarted. Thus if you restart your computer it will immediately work in all apps.

Note on choosing a shortcut: I chose Command+Shift+M (Command is the ‘apple key’) because it matches the Command+M keyboard shortcut for Minimize/send-to-dock and will be easy for me to remember. You can set it to another combination if you want, but think carefully as you don’t want it to be something that any other applications use or you might have strange results.

EDIT: Well don’t I look stupid. It turns out this keyboard shortcut doesn’t work with Firefox, the application I spend most of my time in! I thought it wasn’t working cause it needed to be restarted but that didn’t fix it either. The problem is that Firefox has its own menu item called “Zoom”, under the View menu, which doesn’t do anything but holds the page zooming functions inside it. For whatever reason this means that the configuration described above activates that menu item and stops the Window > Zoom menu item from working. GAH! I might have to try the app mentioned in the comments to find true happiness.

Posted by jeremyclarke on
Filed under General

9 Comments

  1. Martin Reisch

    March 15th, 2010 at 2:22 pm

    awesome tip. the Keyboard Shortcuts customizability in Snow Leopard is fantastic. that being said, i’ve found much sanity in these two apps which take things a bit further:

    SIZEUP: http://www.irradiatedsoftware.com/sizeup/
    CINCH: http://www.irradiatedsoftware.com/cinch/

    one is the keyboard version, the other is the mouse drag version

    both indespensable and totally affordable. if you need to be able to (gulp, do what windows 7 can do) on your mac and snap two safari windows as 50% left and 50% right of your screen. or two finder windows…. ect.

    anyhow. great tip, just wanted to add these other options i found and am finding hard to be without them when using other peoples Macs!

  2. Joey Mornin

    March 15th, 2010 at 2:47 pm

    Great tip. The thing that still bugs me, though, is that the green jewel button doesn’t always maximize the window. In some apps, it just changes the window size. Is this different in Snow Leopard? Or do you know a workaround?

  3. jeremyclarke

    March 18th, 2010 at 11:11 pm

    Joey: I’ve actually noticed a total turnaround on green jewel in Snow Leopard. It seems to be totally undocumented in the HIG (the guidelines apple publishes) but as far as I can tell in 10.6 green jewel switches between full-window and previous-state, rather than the insanity it has wreaked in all other versions of OSX (making windows smaller than you’d ever want them, making them tall and thin or short and fat for no reason). That alone is worth the 35$ upgrade ;)

  4. Joey Mornin

    March 18th, 2010 at 11:13 pm

    Wow. I think you’re right–I’d pay $35 for that. Definitely my least favorite feature in OS X. Until now, hopefully!

  5. SizeUp « Sound and Complete

    January 31st, 2011 at 5:51 pm

    [...] keyboard shortcut for maximizing a window. All right, you can, sort-of. There are ways of assigning keyboard action that corresponds to the green (+) button that’s in the top left corner of every [...]

  6. Svink

    April 20th, 2011 at 8:14 am

    you. are. a. god. thankyou.

  7. Pedro Gordo

    April 20th, 2011 at 2:51 pm

    Thanks, mate! Really helpful!

  8. Justin

    May 26th, 2011 at 10:06 pm

    After reading a few pessimists who said it was impossible without third party software (which seems extreme and silly to me) I stumbled my way across this extremely elegant and useful nugget of gold. Thanks.

  9. David

    January 24th, 2012 at 5:09 am

    Thanks – this really helped. I often use an external monitor and when I unplug it the windows end up in random places with the controls out of reach. Maximizing via keystroke fixes this.

Add new comment (email only seen by Jeremy)