Sat, 19 May 2007

Dealing with multiple email addresses in mutt

I recently watched Bram Moolenaar's "7 Habits for Effective Text Editing 2.0" Google Tech Talk presentation, which inspired me to dust off the old vimrc and poke around for a bit. I tend to live most of my life inside of vim, which is actually a pretty kickass place to live (I even started working on a life.vim script to replace my [excessive] tomboy usage, and add a bit of GTD sauce).

I use mutt for my email accounts, and recently made some modifications to my vimrc to help automate a task that utilizes far too many of my keystrokes each day: changing the From field of outgoing messages.

let g:addresses = ['lewk csh rit edu', 'lmacken redhat com', 'lmacken fedoraproject org']
function NextEmailAddress()
    if !exists("g:email_idx")
        let g:email_idx = 0
    s@^\(From:.*<\).*>@\=submatch(1) . g:addresses[g:email_idx % len(g:addresses)] . ">"@
    let g:email_idx += 1
map <silent> @ :call NextEmailAddress()<CR>

This lets you cycle through your email addresses by pressing '@' when composing a new mail. From here, my messages go through esmtp, which ships them off to the proper SMTP server based on the identity of the mail.

I'd be curious to hear of any other tweaks people have made to their vimrc's to help improve their mutt usage, or of any life-changing hack that saves you tons of keystrokes every day.

posted at: 19:15 | link | Tags: , , , | 1 comments

Posted by gentoo at Mon Dec 28 19:41:01 2009

I like CheckAttach very much. Frequently I announce an attachment in the mail but then forget to attach it. CheckAttach scans the mail for keywords and asks me (directly in VIM!) whether to add files  - even with VIM's nifty tab completion.

Here's the link:

Are there any other enhancements you are aware of?