Categories
Uncategorized

mutt completion in zsh

After a little while spent battling with zsh’s completion system today, I have made it complete my aliases file. My setup is slightly non standard (although not that unusual I think) in that the aliases aren’t defined in my ~/.muttrc file. Instead, they’re in ~/.mail_aliases. To get zsh to know about this requires a small function to go in your ~/.zshrc:

_email-mutt() {
    files[$plugin]=~/.mail_aliases
    _email-mail
}

I managed to get that by looking at the source for the _email_addresses completion function. I don’t know how I could have got by without it. The zsh book should turn up in a few days; maybe that will enlighten me more.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s