In the recent Move messages to a target folder via keyboard shortcut hint, I noticed a user describing a script he'd written to allow him to archive messages from four different Gmail accounts. I replied with this simpler suggestion, and I think perhaps it might merit being considered as a hint in its own right. A quick search of the site didn't show that it'd been posted before.
When you define your Gmail account in Mail.app, make sure you do the following:
When you're going through your inbox, to archive a message, simply delete it. As Gmail uses tags, not folders, you're not actually telling Gmail to delete the message, but rather to remove the 'Inbox' tag from the message. Without the 'Inbox' tag, the message will no longer show up in your Inbox, but it won't be deleted from your account; it's still accessible under 'All Mail.'
This is exactly the same as clicking on the Archive button for messages when you're using gMail's web interface. So deleting == archiving; it's not intuitive at first, but it's sure easy to remember and quick to perform.
If deleting is archiving, you may be wondering, what should you do if you really want to delete a message? This is also simple, but not initially obvious: Flag the message as junk mail.
Mail.app will move the message out of your Inbox and into your Junk folder, which also happens to be Gmail's Spam folder. In other words, when you click on a messages's Junk button, you're telling gMail to remove the 'Inbox' tag from the message, and apply the 'Spam' tag. So the message will show up in your Gmail account's Spam folder, and it will be automatically deleted when it gets to be thirty days old (the age at which Gmail automatically deletes Spam messages).
So, to archive, delete. To delete, junk. It really will make sense, I promise.
Mac OS X Hints
http://hints.macworld.com/article.php?story=20091221173506630