Querying Lbdb from Vim

In spite of my attempts for replacing Mutt with Evolution I gave up for several reasons, mainly in my experience Evolution isn't stable enough with huge mailboxes: it crashes often and is painfully slow. Now I'm back at using Mutt, but at least I've learned to use the Evolution address book which is nice, integrated with other Gnome apps (gaim for example), and strictly more powerful than the Mutt address book.

I'm using lbdb to query the Evolution address book from Mutt via the external address queries mechanism. But that sucks in various ways:

  1. names should be expanded one by one hitting CTRL-T, changing the headers in Mutt one by one (first To:, then Cc:, then ...)

  2. I like to edit headers while composing the mail in Vim, but names written there in the various recipient lines (To:, Cc:, ...) are not handled properly. For example if I fill the To: line with To: name surname when exiting Vim mutt will collapse it in a header To: namesurname which can no longer be passed successfully to lbdb

My solution is lbdbq.vim a plugin for Vim which enables expansion of contact names directly withing Vim (normal/insert/visual modes). It supports multiple matches asking interactively the user to choose among them and can be used to replace all contacts in one or more recipient lines at once.

It's new, so it's probably bugged. If you sit like me at the intersection Mutt/Vim/Evo-address-book please test it and give me some feedback.

As a side note, this is the first time I program in vimscript after the release of Vim 7.0. I have to admit that is really becoming more pleasant than what it used to be. Lists and Dictionaries really (try to) bridge the gap between pre-7.0 vimscript and programming Vim with external languages (python/perl/...).

Update #1: lbdbq.vim 0.2 released with an important bug fix for RFC822 fields continuation line and other minor improvements.

Update #2: Vimscript #388 provides similar features to lbdbq.vim and is older. Still lbdbq.vim is more feature-complete, have a look at the Discussion page fore more info.