Thursday Night

Paul Betts’s personal website / blog / what-have-you

A better Maximize button for Mac + Vim

5 comments

I wrote about this before in a previous article, but this method has problems with Leopard and QuickSilver; its mechanism uses some clever-yet-not-maintainable methods to work. However, I finally tried Peter Maurer’s Witch, and it covers the same functionality, but with much less hacking.

To complete the fix for me, one of the things that I really miss full Maximize for is the Mac UI for Vim, MacVim. The developer decided that by default, hitting zoom does some sort of strange vertical-only maximize. To fix it, use the following command:

defaults write org.vim.macvim MMZoomBoth 1

Written by Paul Betts

May 24th, 2008 at 3:08 pm

Posted in Apple

5 Responses to 'A better Maximize button for Mac + Vim'

Subscribe to comments with RSS or TrackBack to 'A better Maximize button for Mac + Vim'.

  1. Thanks. I see why this was done—it’s because some people like to maximize vertically and not lose their chosen number of characters width (usually 80). I loved FVWM for that very reason, but more important is an actual maximization button, since usually the cause for maximizing is to fit more width on the screen when reading someone’s code who obviously thinks everyone has 200-character terminals/editors.

    Hans Fugal

    26 May 08 at 8:57 pm

  2. @Hans: I would buy that if its initial window width was set to ‘tw’ characters, but afaik it’s hard-coded to 80. I see what you’re saying though

    Paul Betts

    26 May 08 at 11:46 pm

  3. I wrote a SIMBL plugin last year to change Safari’s ‘Zoom’ button behavior from “fit to contents” (which doesn’t), to “maximizize” (no typo). This involved messing with SIMBL and classdump so I could replace the Safari Cocoa function that returns a box size that fits the data with my own routine that just returns the size of the screen (for a real maximize experience).

    I’d like to be able to extend this so that EVERY [Cocoa*] app’s zoom button does a maximize, but I haven’t dug deep enough into the undocumented bits with classdump. And, as I no longer use Safari, I was wondering if anybody knows what I’d replace to get this to work with ALL [Cocoa*] apps. In Safari, it was “(NSRect)windowWillUseStandardFrame:(id)sender defaultFrame:(NSRect)rect” from the “BrowserWindowController” class.

    *SIMBL only works with Cocoa apps, for those not in t3h know.

    Too bad not everyone included a defaults option like MacVim :(

    4ndy

    16 Jul 08 at 2:54 am

  4. @4ndy: There’s already a SIMBL plugin that does this called Stoplight written by Andy Matuschak (of Sparkle fame), but it makes QS coredump – I’d check out his code and see if you can fix it up.

    Paul Betts

    17 Jul 08 at 11:16 am

  5. If your filesystem is case sensitive you should use
    org.vim.macvim instead of org.vim.MacVim.

    At least I had one org.vim.macvim.plist with all sort of settings and
    one org.vim.MacVim.plist with only this setting and vim was not reading the capitalized version.

    Thanks for your post!

    fede

    11 Dec 09 at 4:10 pm

Leave a Reply