Ⅰ. 插件描述
query lbdb from VimⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin '/lbdbq'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle '/lbdbq'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug '/lbdbq'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/vim-scripts/lbdbq
Ⅳ. 文档说明
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.