Skip to content

Commit 22be014

Browse files
committed
adding composer and nvim configs
1 parent 65cc3d0 commit 22be014

7 files changed

Lines changed: 89 additions & 12 deletions

File tree

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,11 @@ Keep your inbox clean without effort.
199199
> neomd moves, deletes, and modifies emails directly on your IMAP server. These operations affect your mailbox across all devices. **Back up important emails before first use.** neomd is experimental software and can't take responsibility for lost or misplaced emails. Consider testing with a secondary email account first.
200200
201201
> [!NOTE]
202-
> **Optional attachment helpers:**
202+
> **Optional Neovim & file picker helpers:**
203203
> - `yazi` enables the built-in file picker used by pre-send `a`
204204
> - custom Neovim integration in `custom.lua` enables inline `<leader>a` attachment insertion inside `neomd-*.md` buffers
205-
> - without these, neomd still works; the inline Neovim attachment workflow just won't be available
205+
> - a small `markdown.lua` plugin spec gives you **live, beautiful rendered Markdown** (headings, code blocks, callouts) while composing — see [Beautiful Markdown Composer with Live-Preview in Neovim](https://neomd.ssp.sh/docs/sending/#beautiful-markdown-composer-with-live-preview-in-neovim)
206+
> - without these, neomd still works; the inline Neovim attachment workflow and live rendering just won't be available
206207
207208
```sh
208209
git clone https://github.com/ssp-data/neomd

docs/content/docs/_index.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,10 +206,11 @@ neomd moves, deletes, and modifies emails directly on your IMAP server. These op
206206

207207

208208
{{< callout type="info" >}}
209-
**Optional attachment helpers:**
209+
**Optional Neovim & file picker helpers:**
210210
- `yazi` enables the built-in file picker used by pre-send `a`
211211
- custom Neovim integration in `custom.lua` enables inline `<leader>a` attachment insertion inside `neomd-*.md` buffers
212-
- without these, neomd still works; the inline Neovim attachment workflow just won't be available
212+
- a small `markdown.lua` plugin spec gives you **live, beautiful rendered Markdown** (headings, code blocks, callouts) while composing — see [Beautiful Markdown Composer with Live-Preview in Neovim](https://neomd.ssp.sh/docs/sending/#beautiful-markdown-composer-with-live-preview-in-neovim)
213+
- without these, neomd still works; the inline Neovim attachment workflow and live rendering just won't be available
213214
{{< /callout >}}
214215

215216

docs/content/docs/sending.md

Lines changed: 83 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,81 @@
11
---
2-
title: Sending Emails
2+
title: "Sending Emails (Composer)"
33
weight: 5
44
---
55

6-
neomd sends every email as `multipart/alternative`:
6+
## Beautiful Markdown Composer with **Live-Preview** in Neovim
7+
8+
Since you compose every email in Neovim as a `neomd-*.md` buffer, a small markdown plugin setup makes the writing experience much nicer — headings get colored blocks, code fences get borders, bullets get spacing, and callouts (`> [!note]`) render with icons live as you type.
9+
10+
### Workflow of Writing and Composing an Email
11+
1. **Pre-Composer**: Fill in your emails and subject:
12+
![neomd in neovim with rendered markdown](/images/composing-1.png)
13+
14+
2. **Composer**: Write your email in Neovim with Markdown rendering enabled (see configs below):
15+
![neomd in neovim with rendered markdown](/images/composing-2.png)
16+
17+
3. **Post-Composer and Pre-Sent View**: Preview, change FROM sender, attach files, etc.:
18+
![neomd in neovim with rendered markdown](/images/composing-3.png)
19+
20+
4. **Preview in Browser**: Preview email in Browser - shows emails, Markdown rendered HTML.
21+
![neomd in neovim with rendered markdown](/images/composing-4.png)
22+
23+
### Optional Neovim Configuratios
24+
*Recommended for nice look and live rendering while you compose your emails*
25+
26+
The single plugin that does most of the work is [render-markdown.nvim](https://github.com/MeanderingProgrammer/render-markdown.nvim). Drop this file into your lazy.nvim plugin folder (e.g. `~/.config/nvim/lua/plugins/markdown.lua`):
27+
28+
```lua
29+
return {
30+
-- Live inline rendering: headings, code blocks, bullets, callouts
31+
{
32+
"MeanderingProgrammer/render-markdown.nvim",
33+
ft = { "markdown" },
34+
dependencies = { "nvim-treesitter/nvim-treesitter", "nvim-tree/nvim-web-devicons" },
35+
keys = {
36+
{ "<leader>mr", ":RenderMarkdown toggle<CR>", desc = "Markdown render toggle" },
37+
},
38+
opts = {
39+
heading = {
40+
sign = false,
41+
position = "inline",
42+
icons = { "# ", "## ", "### ", "#### ", "##### ", "###### " },
43+
width = "block",
44+
left_pad = 2,
45+
right_pad = 4,
46+
},
47+
code = {
48+
sign = false,
49+
left_pad = 2,
50+
right_pad = 4,
51+
border = "thick",
52+
},
53+
bullet = { right_pad = 2 },
54+
},
55+
},
56+
57+
-- Optional: bold / italic / link toggles via Alt-key chords in visual mode
58+
{
59+
"tadmccorkle/markdown.nvim",
60+
ft = "markdown",
61+
opts = {
62+
on_attach = function(bufnr)
63+
local toggle = function(key)
64+
return "<Esc>gv<Cmd>lua require'markdown.inline'"
65+
.. ".toggle_emphasis_visual'" .. key .. "'<CR>"
66+
end
67+
vim.keymap.set("x", "<M-i>", toggle("i"), { buffer = bufnr }) -- italic
68+
vim.keymap.set("x", "<M-b>", toggle("l"), { buffer = bufnr }) -- bold
69+
vim.keymap.set("x", "<M-k>", toggle("l"), { buffer = bufnr }) -- link
70+
end,
71+
},
72+
},
73+
}
74+
```
775

8-
- **`text/plain`** — the raw Markdown you wrote (readable as-is in any client)
9-
- **`text/html`** — rendered by [goldmark](https://github.com/yuin/goldmark) with a clean CSS wrapper
76+
Toggle rendering on/off with `<leader>mr`. For the full version (with browser preview, wikilinks, custom highlights), see my live config at [markdown.lua](https://github.com/sspaeti/dotfiles/blob/master/nvim/.config/nvim/lua/sspaeti/plugins/markdown.lua).
1077

11-
This means recipients using Gmail, Apple Mail, Outlook, etc. see properly formatted links, bold, headers, inline code, and code blocks — while you write nothing but Markdown.
1278

13-
When attachments are present the MIME structure is upgraded automatically:
14-
- **Images**`multipart/related` with `Content-ID` — displayed inline in the email body
15-
- **Other files** (PDF, zip, …) → `multipart/mixed` — shown as downloadable attachments
1679

1780
## Multiple From Addresses
1881

@@ -248,6 +311,18 @@ Simon
248311
```
249312

250313

314+
## Format that email is sent
315+
neomd sends every email as `multipart/alternative`:
316+
317+
- **`text/plain`** — the raw Markdown you wrote (readable as-is in any client)
318+
- **`text/html`** — rendered by [goldmark](https://github.com/yuin/goldmark) with a clean CSS wrapper
319+
320+
This means recipients using Gmail, Apple Mail, Outlook, etc. see properly formatted links, bold, headers, inline code, and code blocks — while you write nothing but Markdown.
321+
322+
When attachments are present the MIME structure is upgraded automatically:
323+
- **Images**`multipart/related` with `Content-ID` — displayed inline in the email body
324+
- **Other files** (PDF, zip, …) → `multipart/mixed` — shown as downloadable attachments
325+
251326

252327
## Mailto Handler
253328

docs/static/images/composing-1.png

79.8 KB
Loading

docs/static/images/composing-2.png

151 KB
Loading

docs/static/images/composing-3.png

96.6 KB
Loading

docs/static/images/composing-4.png

70.2 KB
Loading

0 commit comments

Comments
 (0)