]> 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:

squash consecutive empty lines in mails
[etc/lazyvim.git] / .config / lazyvim / after / ftplugin / mail.lua
index 39eaf3e1639ce29997a05ad1eca1bc287e4f5564..176382c30e9e39869ddfd4f495ee65af0e8cc0f3 100644 (file)
@@ -23,6 +23,14 @@ vim.opt_local.formatoptions:remove("l") -- would not break lines that were long
 vim.opt_local.commentstring = "> %s" -- commenting means quoting in mails
 -- }}}
 
+-- {{{ autocmds
+vim.api.nvim_create_autocmd({ "BufWrite" }, {
+  buffer = 0,
+  group = vim.api.nvim_create_augroup("squashemptylines", { clear = true }),
+  command = [[%s/\v(\n)\n+$/\1/ge]],
+})
+-- }}}
+
 -- {{{ keymaps
 vim.keymap.set("n", "<leader>m", "", { buffer = true, desc = "mail functions" })
 vim.keymap.set("n", "<leader>ms", "", { buffer = true, desc = "subject manipulation" })