sponsor Vim development Vim logo Vim Book Ad

vim-mailquery : complete e-mail addresses in Vim by those in your inbox

 script karma  Rating 0/0, Downloaded by 43  Comments, bugs, improvements  Vim wiki

created by
Enno Nagel
script type
This plug-in lets you complete e-mail addresses in Vim by those in your
inbox (or any other mail folder) via https://github.com/pbrisbin/mail-query

1. Usage

When you're editing a mail file in Vim that reads

    From: Fulano <Fulano@Silva.com>
    To:      foo

and in your Inbox there is an e-mail from

    Mister Foo <foo@bar.com>

and your cursor is right after foo, then hit Ctrl+X Ctrl+O to obtain:

    From: Fulano <Fulano@Silva.com>
    To:      Mister Foo <foo@bar.com>

That is, you can complete e-mail addresses inside Vim by pressing CTRL-X
CTRL-O inside insert mode. See also :help i_CTRL-X_CTRL-O and :help

2. Setup

2.1. Download and install (by `sudo make install`) mail-query from
    If you have no superuser rights, then compile it (by `make`) and
    add the path of the folder that contains the obtained executable
    mail-query (say `~/bin`) to your environment variable `$PATH`: in
    case you use `bash` or `zsh`, by adding to `~/.profile` or
    `~/.zshenv` the line


    To decode 7-bit ASCII encoded MIME-headers as specified at
    https://tools.ietf.org/html/rfc2047) (which start, for example,
    with `=?UTF-8?`), ensure that `perl` is executable and the
    Encode::MIME:Header module is installed.

2.2. The mail folder is automatically set to the value of the variable
    `$folder` in the file `~/.muttrc`. To explicitly set the path to a
    mail folder `$folder`, add to your `.vimrc` the line

      let g:mailquery_folder = '$folder'

    For example, if you use mbsync, then `$folder` could be


2.3. If you would like to filter out most probably impersonal e-mail
    addresses such as those coming from mailer daemons or accepting no
    reply, then try adding

    let g:mailquery_filter = 1

    to your `vimrc`, which will discard e-mail addresses that satisfy
    the regular expression given by the variable `g:mailquery_filter_regex`.

3. Related Plug-in:

The Vim plug-in https://github.com/Konfekt/vim-mutt-aliases lets you
complete e-mail addresses in Vim by those in your mutt aliases file,
and (when the alias file is periodically populated by the mutt-alias.sh
shell script from https://github.com/Konfekt/mutt-alias.sh) gives a
more static alternative to this plug-in.


This plug-in is developed at https://github.com/Konfekt/vim-mailquery
where issues can be filed.

install details
Unzip vim-mailquery.zip into  ~/.vim on Linux or or MacOS.

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
vim-mailquery.zip 1.2 2019-07-10 7.0 Enno Nagel decode 7-bit ASCII encoded MIME-headers
vim-mailquery.zip 1.1 2019-06-19 7.0 Enno Nagel sort matches by pertinence and optionally filter out impersonal addresses
vim-mailquery.zip 1.0 2019-06-14 7.0 Enno Nagel Initial upload
ip used for rating:

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.
OSDN.net Logo