Provides code snippets generated from mutt or neomutt configurations for the snippet engine mini.snippets of the great mini.nvim library for Neovim.
Two types of snippets are supported:
-
Signature snippets for email signatures with the standard delimiter.
-
From-address snippets for the from header.
Only the from-address signatures are depending on muttrc syntax, but the signature-snippets are actually independent of mutt and could also be used by non-mutt users.
The follow code installed this package by means of mini.deps.
local add = MiniDeps.add
add({ source = 'shuber2/mini-snippets-mutt.nvim' })
require("mini-snippets-mutt").setup()And this is the default configuration:
require("mini-snippets-mutt").setup({
-- List of signature files
signature_files = {
os.getenv("HOME") .. "/.*mutt/signatures/*",
},
-- The standard delimitor as signature prefix
signature_prefix = "-- \n",
-- List of muttrc files to parse
muttrc_files = {
os.getenv("HOME") .. "/.*muttrc",
os.getenv("HOME") .. "/.*mutt/*muttrc",
},
})The implementation uses the mini.snippets feature of Lua-based snippets, so
this is quite tied to this snippet engine. It works as follows:
-
For each
${signaturefile}, a signature snippet is created based on the filename containing the signature content. The extension of the file is stripped. For the default configuration,~/.mutt/signatures/private.emlcreates a snippetsig-privatethat populates to the content of this file. -
Each
${muttrcfile}is parsed and for each line of the formset from "${ADDRESS}"a snippet is created based on the domain of the mail address. In the default configuration,set from John Smith <jsmith@example.org>in~/.mutt/foo.muttrccreates a snippetfrom-example.orgthat populates toJohn Smith <jsmith@example.org>.
- vim-mail - A plugin for composing emails in Vim