Skip to content

Instantly share code, notes, and snippets.

@0x00dec0de
Forked from kaleb/aliases
Created April 20, 2016 23:29
Show Gist options
  • Save 0x00dec0de/10adc5eb5ebd68f7ede0b77c6366f17d to your computer and use it in GitHub Desktop.
Save 0x00dec0de/10adc5eb5ebd68f7ede0b77c6366f17d to your computer and use it in GitHub Desktop.
Gmail on Mutt
#~/.mutt/aliases
alias nick Nicholas Levandoski <[email protected]>
alias tim Timothy Pitt <[email protected]>
alias steven Steven Jackson <[email protected]>
alias kaleb Kaleb Hornsby <[email protected]>
alias alug-admin nick, tim, steven
#~/.mutt/muttrc
# Change the next 7 lines appropriately.
set imap_user = [email protected]
set imap_pass = secret
set smtp_url = smtp://[email protected]:587/
set smtp_pass = secret
set from = [email protected]
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