Skip to content

Instantly share code, notes, and snippets.

@kaleb
Created October 15, 2011 15:51
Show Gist options
  • Save kaleb/1289741 to your computer and use it in GitHub Desktop.
Save kaleb/1289741 to your computer and use it in GitHub Desktop.
Gmail on Mutt
#~/.mutt/aliases
alias nick Nicholas Levandoski <nick.levandoski@auglug.org>
alias tim Timothy Pitt <timothy.pitt@auglug.org>
alias steven Steven Jackson <sjackson@auglug.org>
alias kaleb Kaleb Hornsby <kaleb.hornsby@auglug.org>
alias alug-admin nick, tim, steven
#~/.mutt/muttrc
# Change the next 7 lines appropriately.
set imap_user = thekaleb@gmail.com
set imap_pass = secret
set smtp_url = smtp://thekaleb@smtp.gmail.com:587/
set smtp_pass = secret
set from = thekaleb@gmail.com
set realname = "Kaleb Hornsby"
set editor = 'vim -c "set spell spelllang=en_us"'
# Don't let your firewall kill your idle connection.
set imap_keepalive = 900
# Do not copy sent mail. Gmail smtp already does this.
set copy = no
set folder = imaps://imap.gmail.com:993
set spoolfile = +INBOX #or +[Gmail]/Important
set postponed = +[Gmail]/Drafts
# This is using the 'trash' patch.
set trash = +[Gmail]/Trash
# Cache
set header_cache = ~/.mutt/cache/headers
set message_cachedir = ~/.mutt/cache/bodies
set certificate_file = ~/.mutt/certificates
# Gmail style keybindings
bind editor <space> noop
bind index,pager c mail #Compose
macro index,pager e "<save-message>=[Gmail]/All Mail<enter><enter>" "Archive conversation"
bind generic x tag-entry #Select Conversation
bind index x tag-thread #Select Conversation
bind pager x tag-message #Select Conversation
bind index,pager s flag-message #Star a message
macro index,pager + <save-message>=[Gmail]/Important<enter><enter> "Mark as important"
macro index,pager ! <save-message>=[Gmail]/Spam<enter><enter> "Report spam"
bind index,pager a group-reply #Reply all
bind index,pager \# delete-thread #Delete
bind index,pager l copy-message #Label
bind index,pager v save-message #Move to
macro index,pager I <set-flag>O "Mark as read"
macro index,pager U <clear-flag>O "Mark as unread"
macro index,pager ga "<change-folder>=[Gmail]/All Mail<enter>" "Go to all mail"
macro index,pager gs <change-folder>=[Gmail]/Starred<enter> "Go to 'Starred'"
macro index,pager gd <change-folder>=[Gmail]/Drafts<enter> "Go to 'Drafts'"
macro index,pager gl <change-folder>? "Go to 'Label'"
macro index,pager gi <change-folder>=INBOX<enter> "Go to inbox"
macro index,pager gt "<change-folder>=[Gmail]/Sent Mail<enter>" "Go to 'Sent Mail'"
folder-hook +INBOX 'macro index,pager y "<save-message>=[Gmail]/All Mail<enter><enter>" "Archive conversation"'
folder-hook +[Gmail]/Trash macro index,pager y <save-message>=INBOX<enter><enter> "Move to inbox"
folder-hook +[Gmail]/Starred bind index,pager y flag-message #"Toggle star"
# This should be ' »›-‹L' to match Gmail, but $to_chars breaks on unicode.
set to_chars = ' +>-<L'
# Don't move read mail.
set move = no
# Sort by newest conversation first.
set sort = reverse-threads
set sort_aux = last-date-received
# Contact aliases, could also use `goobook`.
set alias_file = ~/.mutt/aliases
set sort_alias = alias
set reverse_alias = yes
set reverse_name = yes
source $alias_file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment