• Home
  • Blog
  • MailMate keyboard shortcuts and Gmail archive handling

MailMate keyboard shortcuts and Gmail archive handling

Vincent Danen

December 28, 2013

So, playing around with MailMate I've found you can create keyboard shortcuts. It comes with a standard keyboard shortcut list, one for Postbox (a Thunderbird-based email client), and Gmail. My main need here to is to map "delete" to "Archive message" because MailMate, unlike Apple's Mail, does not seem to have a setting to turn "delete" into "archive". So when I hit the delete key, my message goes to the trash, rather than just removing the label of the current mailbox (so if it's in the Inbox, remove the "Inbox" label, which removes it from the mailbox but keeps it in Gmail's "All Mail").

First thing's first, we need to create our new keybinding list. To do this, copy the Standard.plist from /Applications/MailMate.app/Contents/Resources/KeyBindings (to reveal this in the Finder, right-click the MailMate application icon and select "Show Package Contents". This is where you'll find the three keybinding plist files: Gmail, Postbox, and Standard.

Create the directory to store the new keybinding file:

% cd ~/Library/Application\ Support/MailMate
% mkdir -p Resources/KeyBindings
% cp /Applications/MailMate.app/Contents/Resources/KeyBindings/Standard.plist Resources/KeyBindings/Mutt.plist

This creates a new plist file called Mutt.plist. You can edit this file with any text editor. I suggest copying one of the existing plist files as it will have some of the commands you may already want in there with the funky characters like the down arrow, etc.

The important one (to me) is this:

"\UF728" = "deleteMessage:";

I don't want that backspace key to delete the message. You can use the "archive" command here, which will remove it from the mailbox (and remove its label) but this also puts it into a new "[Gmail]/Archive" folder. This folder doesn't exist normally. So while it does accomplish what I want (remove it from the specified mailbox without actually permanently deleting the message), it does it in a wonky way.

Ahh, this leads to more Gmail-related things. Writing blog posts while working through issues is so much fun. =)

The problem here is that I imported these from Apple Mail rather than creating them as new accounts. In the 1.7.1 release notes we see:

  • New: Changed default behavior for new Gmail accounts. 1. “[Gmail]/All Mail” is subscribed. 2. Default archive mailbox is “[Gmail]/All Mail”. Existing accounts are not affected."

Interesting. So when I go to edit the IMAP account, I see that these are not subscribed. So this gets us more like Apple Mail where it also note too downloads the All Mail folder (some people have an issue with this... I never have, I kinda like that it's all downloaded). So I had "All Mail", "Important", and "Starred" unsubscribed. The "Important" one can remain unsubscribed as that's what Gmail thinks is important, not me. All Mail is subscribed to, and so is Starred. MailMate has nice smart mailboxes so you don't need to have the Starred one (it has a default smart mailboxes called "Flagged" which shows you flagged messages in each mailbox.. unfortunately, with three email accounts handled by MailMate, having three "INBOX" smart folders means I can't zero in on one specific account; the Starred mailbox will let me do that).

The other thing I noticed in the 1.7.1 release notes is this:

  • New: Changed default behavior for new Gmail accounts. 1. “[Gmail]/All Mail” is subscribed. 2. Default archive mailbox is “[Gmail]/All Mail”. Existing accounts are not affected.

The nice thing is that it seems when you subscribe to "[Gmail]/All Mail", the default archive mailbox is changed as well (so if you archive messages, it goes to All Mail rather than Archive).

So now we can get back to your keyboard shortcuts. As noted above, we can now change the "deleteMessage" command to "archive" and have it do what we want:

"\UF728" = "archive:";

Now, because it is useful to be able to permanently delete stuff, we can have something like "^d" or some such to permanently delete:

"^d" = "deleteMessage:";

Anyways, calling this "Mutt" keybindings is a bit of a misnomer because they're not default mutt keybindings (although some of them are for my mutt setup), but here's my Mutt.plist:

    "\UF728" = "archive:";               // ?  (forward-delete)
    "\U007F" = "archive:";               // delete
    "^d"     = "deleteMessage:";         // CTRL-D
    " "      = "scrollPageDown:";        // Space (alternatively it can be bound to scrollPageDownOrNextUnreadMessage:)
    "$ "     = "scrollPageUp:";          // Shift-space
    "\U000A" = "openMessages:";          // Return
    "\U000D" = "openMessages:";          // Enter

    "m"      = "newMessage:";
    "r"      = "replySender:";
    "G"      = "replyAll:";             // group reply
    "R"      = "replyList:";            // list reply
    "f"      = "forwardMessage:";
    "F"      = "toggleFlag:";           // flag-message
    "/"      = "mailboxSearch:";
    "^/"     = "searchAllMessages:";
    "~e"     = "expandThread:";         // OPT-E

This is just my "starting" list. I'll be tweaking it as I get used to MailMate more. So far, so good...

More information is found in the MailMate Custom key bindings section of the online manual.

EDIT: I removed the bits about the custom keybindings not overriding the Standard.plist keybindings as, poking around further, I realized that you need to restart MailMate in order for it to pickup the new keybindings and that was why it did not appear to be working correctly.

Leave a Comment

Comments use MarkDown. Need help? MarkDown Cheatsheet