Skip to content

shuber2/mini-snippets-mutt.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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:

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.

Quickstart

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",
  },
})

Details

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.eml creates a snippet sig-private that populates to the content of this file.

  • Each ${muttrcfile} is parsed and for each line of the form set from "${ADDRESS}" a snippet is created based on the domain of the mail address. In the default configuration, set from John Smith <[email protected]> in ~/.mutt/foo.muttrc creates a snippet from-example.org that populates to John Smith <[email protected]>.

Related plugins

  • vim-mail - A plugin for composing emails in Vim

About

Neovim snippets from mutt configurations (signatures, from address)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages