Is there a decent formatter for markdown that I can integrate with neovim. I mostly need auto-wrapping to 80 characters for text both when inserting new text and editing previous paragraphs, any other feature is a bonus. Here’s the current configuration that I am using, but for long paragraphs it gets super-slow and it has some edge cases where it fails:
local markdown_augroup = vim.api.nvim_create_augroup("Markdown", { clear = true })
vim.api.nvim_create_autocmd({ "BufNewFile", "BufRead" }, {
group = markdown_augroup,
pattern = { "*.md" },
callback = function(opts)
bufnr = opts["buf"]
vim.bo.textwidth = 80
vim.bo.formatoptions = "tcqawjp]"
end,
})