From 8b10fec3cea6c9b671aa4c3c5d0f6125332c3f72 Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Mon, 28 Apr 2025 17:53:34 +0200 Subject: [PATCH] add mail functions for subject manipulation --- .config/lazyvim/after/ftplugin/mail.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.config/lazyvim/after/ftplugin/mail.lua b/.config/lazyvim/after/ftplugin/mail.lua index 36c6ead..f0b87eb 100644 --- a/.config/lazyvim/after/ftplugin/mail.lua +++ b/.config/lazyvim/after/ftplugin/mail.lua @@ -20,6 +20,23 @@ vim.opt_local.formatoptions:append("a") vim.opt_local.formatoptions:append("w") vim.opt_local.formatoptions:append("n") +vim.keymap.set("n", "m", "", { buffer = true, desc = "mail functions" }) +vim.keymap.set("n", "ms", "", { buffer = true, desc = "subject manipulation" }) + +vim.keymap.set( + "n", + "msn", + ":1,/^$/s,\\v(Subject:)\\s*((Re|AW):\\s*)*((.|\\_s\\s+)+),\\1 (was: \\4),e:set nohlsWhi", + -- set nohlsf li", + { buffer = true, desc = "make a new subject" } +) +vim.keymap.set( + "n", + "msd", + '1G/\\v^Subject:(.|\\_s\\s+)+was:/e:set nohls"_dab', + { buffer = true, desc = "remove old subjects" } +) + vim.keymap.set("n", "p", "", { buffer = true, desc = "mailplate profiles" }) vim.keymap.set( -- 2.39.5