X-Git-Url: https://git.madduck.net/etc/lazyvim.git/blobdiff_plain/1b848da4193db006dcac306691185f7dd785a44c..a71412ea7e1310a3e035fbcd414d3540e92764a5:/.config/lazyvim/after/ftplugin/mail.lua diff --git a/.config/lazyvim/after/ftplugin/mail.lua b/.config/lazyvim/after/ftplugin/mail.lua index 39eaf3e..176382c 100644 --- a/.config/lazyvim/after/ftplugin/mail.lua +++ b/.config/lazyvim/after/ftplugin/mail.lua @@ -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", "m", "", { buffer = true, desc = "mail functions" }) vim.keymap.set("n", "ms", "", { buffer = true, desc = "subject manipulation" })