https://github.com/choener/notmuch.nvim
Plugin to overlay email Message-IDs with the email subject. Requires notmuch.
https://github.com/choener/notmuch.nvim
neomutt neovim-plugin notmuch
Last synced: 8 months ago
JSON representation
Plugin to overlay email Message-IDs with the email subject. Requires notmuch.
- Host: GitHub
- URL: https://github.com/choener/notmuch.nvim
- Owner: choener
- License: bsd-2-clause
- Created: 2023-08-20T14:07:30.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2024-02-28T23:21:02.000Z (over 2 years ago)
- Last Synced: 2024-02-29T01:32:38.104Z (over 2 years ago)
- Topics: neomutt, neovim-plugin, notmuch
- Language: Lua
- Homepage:
- Size: 16.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# A simple notmuch plugin for neovim
- This plugin overlays "Message-ID" strings from emails in your text with the "date", "subject", and
"from" information from your emails.
- In addition, this information is used to run notmuch searches and display the results in neomutt.
- This makes it possible to annotate notes with email information and jump into email threads right from your notes.
## Requirements
- `notmuch`:
- your emails to be indexed using `notmuch` itself
- neomutt for jumping to email threads
## Howto use
- Place a string starting with `Message-ID: ` in your text
- Whenever not in insert mode, the line starting with `Message-ID: ...` until the end of the line
will have an overlay with the string: `YYYY-MM-DD HH:MM Subject From| To...To`
- If the Message-ID is unknown, there will be no overlay
- `lua require('notmuch').openNeomutt` jumps to the email chain starting with the Message-ID
- `lua require('notmuch').pickMail` open a telescope picker with all starting emails based on Message-ID
Example:
`Message-ID: ` becomes
`2024-02-29 22:00 Initial Release me@abc.def| you@abc.def`
## Configuration
Configure searches and colors for the overlays:
```
local nme = require'notmuch'
nme.setup({
keys = {
{ 'NOTMUCH', },
{ 'Message%-ID:', { search = '%s*%<([^%>]+)%>',
query = 'id:\'%s\'',
notmuch = 'id:\'%s\'',
},
},
},
})
vim.api.nvim_set_hl(nme.ns, 'EmailDate' , { fg = '#ffffff', bg = '#000099' })
vim.api.nvim_set_hl(nme.ns, 'EmailSubject', { fg = '#ffffff', bg = '#000077' })
vim.api.nvim_set_hl(nme.ns, 'EmailAuthors', { fg = '#ffffff', bg = '#000099' })
vim.api.nvim_set_hl_ns(nme.ns)
```
Configure shortcuts for direct jumps to neomutt or the mail picker (here in an after plugin):
```
local wk = require('which-key')
local ne = require('notmuch')
ne.replaceMessageId()
wk.register({
[''] = {
t = { name = '+neorg',
e = { ne.openNeomutt, 'open neomutt with Message-ID query' },
E = { ne.pickMail, 'Open picker for all Mails' },
},
},
}, { noremap = true, silent = true, })
```
# Devoloper notes
- neovim can decode json to lua objects
-
- notmuch can produce json output