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,
},
},
-- 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.