sponsor Vim development Vim logo Vim Book Ad

lbdbq : query lbdb from Vim

 script karma  Rating 21/6, Downloaded by 1862  Comments, bugs, improvements  Vim wiki

created by
Stefano Zacchiroli
 
script type
utility
 
description
Functions and various mode mappings for querying lbdb (http://www.spinnaker.de/lbdb/) when using Vim to edit mails and mail headers, for example from Mutt (http://www.mutt.org).

Using this utility lines like the following appearing in a Vim buffer:
    To: name surname, name2 surname2
can be automatically converted to lines like
    To: My Friend <foo@example.com>, My Other Friend <bar@example.com>
by querying lbdb.

When the expansion of a given contact is ambiguous (i.e. it corresponds to more than one contact) the user is interactively asked to choose among them.

The utility can be used in various ways:
- in normal mode typing <Leader>lb: the current recipient line will be expanded (i.e. all expandable short names will be expanded to full name/address pairs)
- in insert mode typing <Leader>lb: same as above but without leaving insert mode
- in line visual mode typing <Leader>lb: same as above but all the visually selected line will be subject to expansion
- in visual mode typing <Leader>lb: only the short names contained in the visually selected text will be subject to expansion

RELATED SCRIPTS

I'm (now) aware that vimscript #388 is older than this script of mine and provide similar features. But this script is strictly more powerful (YMMV of course). For example it works in various modes (visual/insert/normal/...), is able to substitute more contacts at once, and takes into account the semantics of recipient lines. E.g.: if you try to expand "name surname" (without double quotes) the plugin looks up for both of them, while vimscript #388 will look up only for the part under the courses, leading more likely to ambiguous answers.
 
install details
A matter of taste. Personally I drop lbdbq.vim in my ~/.vim/ directory and from  ~/.vim/after/ftplugin/mail.vim I do
    source ~/.vim/lbdbq.vim
If you don't mind having this plugin always loaded just drop it in ~/.vim/plugin/
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
lbdbq.vim 0.3 2007-07-22 7.0 Stefano Zacchiroli - quote the name part of returned addresses, so that names with (e.g.) commas does not break the headers
- change license to GPL v3 or above
lbdbq.vim 0.2 2007-01-08 7.0 Stefano Zacchiroli - bugfix for lines which are continuation of RFC822 fields
- added URL field in the plugin
- less stupid vmappings (i.e. more efficient)
- normalize spaces when expanding contacts
- silent mappings
ip used for rating: 3.15.7.23

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github