]> git.madduck.net Git - etc/lazyvim.git/blobdiff - .config/lazyvim/after/ftplugin/mail.lua

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

add mail functions for subject manipulation
[etc/lazyvim.git] / .config / lazyvim / after / ftplugin / mail.lua
index 36c6eade64709b8deff465c03905c2cf7d9c2136..f0b87eb51afe46dd466f9e39158f95599611ee67 100644 (file)
@@ -20,6 +20,23 @@ vim.opt_local.formatoptions:append("a")
 vim.opt_local.formatoptions:append("w")
 vim.opt_local.formatoptions:append("n")
 
 vim.opt_local.formatoptions:append("w")
 vim.opt_local.formatoptions:append("n")
 
+vim.keymap.set("n", "<leader>m", "", { buffer = true, desc = "mail functions" })
+vim.keymap.set("n", "<leader>ms", "", { buffer = true, desc = "subject manipulation" })
+
+vim.keymap.set(
+  "n",
+  "<leader>msn",
+  ":1,/^$/s,\\v(Subject:)\\s*((Re|AW):\\s*)*((.|\\_s\\s+)+),\\1  (was: \\4),e<CR>:set nohls<CR>Whi",
+  -- <CR><cmd>set nohls<CR>f li",
+  { buffer = true, desc = "make a new subject" }
+)
+vim.keymap.set(
+  "n",
+  "<leader>msd",
+  '1G/\\v^Subject:(.|\\_s\\s+)+was:/e<CR>:set nohls<CR>"_dab',
+  { buffer = true, desc = "remove old subjects" }
+)
+
 vim.keymap.set("n", "<leader>p", "", { buffer = true, desc = "mailplate profiles" })
 
 vim.keymap.set(
 vim.keymap.set("n", "<leader>p", "", { buffer = true, desc = "mailplate profiles" })
 
 vim.keymap.set(