macros and keybindings
This is my file for macros and keybindings. Please note that paths are longer because I have two accounts. You may skip the “GMAIL/” part in the path if set folder = is set to that maildir (as in set folder = ~/.mail/GMAIL). If you have a multiple account setting you’ll need to set set folder = ~/.mail/.
##########################################################################
# Mutt general keybinds
macro index,pager I '<shell-escape> offlineimap -o<enter>'
macro index,pager A "<pipe-message>abook --add-email<return>" "add the sender address to abook"
macro generic,index,pager \ca "<shell-escape>abook<return>" "launch abook"
# View URLs inside Mutt with urlview
macro index \cb "|urlview\n"
macro pager \cb "|urlview\n"
#and urlscan
#macro index,pager \cb "<pipe-message> urlscan<Enter>" "call urlscan to extract URLs out of a message"
#macro attach,compose \cb "<pipe-entry> urlscan<Enter>" "call urlscan to extract URLs out of a message"
Please note the <quote-char> in the macros. You WILL NOT need this if your folders don’t contain spaces, or if it works just fine with you.
# Navigation.
macro index,pager gi "<change-folder> =GMAIL/INBOX<enter>" "Go to inbox"
macro index,pager ga "<change-folder> =GMAIL/[Google<quote-char> Mail].All<quote-char> Mail<enter>" "Go to all mail"
macro index,pager gs "<change-folder> =GMAIL/[Google<quote-char> Mail].Sent<quote-char> Mail<enter>" "Go to Sent Mail"
macro index,pager gd "<change-folder> =GMAIL/[Google<quote-char> Mail].Drafts<enter>" "Go to drafts"
# Spam
macro index,pager S "<save-message>=GMAIL/[Google<quote-char> Mail].Spam/<enter>"
# Provide some "on-line" help.
macro generic,index,pager \cv "<shell-escape>gvim ~/Books/Linux/Apps/mutt-manual.txt<enter>"
# Vim-like bindings
bind pager / search
bind pager <up> previous-line
bind pager <down> next-line
bind pager k previous-line
bind pager j next-line
bind pager gg top
bind pager G bottom
bind index gg first-entry
bind index G last-entry
#########################################################################