lbdb completion source for nvim-cmp. Names, emails, and email header recipient formatted completions are provided for contacts found in lbdb.
Use your favorite plugin manager:
-
Plug 'codybuell/cmp-lbdb'
-
git clone https://github.com/codybuell/cmp-lbdb.git ~/.config/nvim/bundle/cmp-lbdb
-
native package manager
git clone https://github.com/codybuell/cmp-lbdb.git ~/.config/nvim/pack/bundle/opt/cmp-lbdb
packadd! cmp-lbdb
-- setup with defaults (markdown and mail file types)
require('cmp').setup({
-- snip...
sources = {
-- snip...
{ name = lbdb },
-- snip...
}
})
-- or alternatively, enable with overrides
require('cmp').setup({
-- snip...
sources = {
-- snip...
{
name = 'lbdb',
option = {
filetypes = {
'mail',
'markdown',
'gitcommit'
},
blacklist = {
'user@host.com',
'.*noreply.*',
},
mail_header_only = true,
use_quotes = false,
},
},
-- snip...
}
})
Default: { 'mail', 'markdown' }
Sets what filetypes the completion source will be made available.
Default: { '.*not?.?reply.*' }
The blacklist sets what emails to exclude from the completion list. The default value will catch variations of noreply
, no-reply
, do-not-reply
, and so on. Lua pattern matching can be used.
Default: false
If set to true
completions will only be provided when in the email header (any line stating with To:, From:, Cc:, etc) of a buffer of mail
filetype. All other enabled filetypes will source completions as normal.
Default: true
If set to true
, will surround the name with double quotes such that elements are generated as "FirstName LastName" <email>
. If set to false, it will not include quotes such that elements are generated as FirstName LastName <email>
. Please see the RFC 5322 standard for mail header specifications.