added mdmath for latex image display.

This commit is contained in:
2026-05-21 13:17:52 +02:00
parent 138dd2d924
commit 9dcc7ec81f
+15 -1
View File
@@ -27,6 +27,7 @@ vim.pack.add({
{ src = "https://github.com/rcarriga/nvim-dap-ui" },
{ src = "https://github.com/michaelrommel/nvim-silicon" },
{ src = "https://github.com/hat0uma/csvview.nvim.git" },
{ src = "https://github.com/Thiago4532/mdmath.nvim" },
})
pcall(vim.cmd.colorscheme, "gruvbox")
@@ -65,10 +66,23 @@ require("conform").setup({
})
require("render-markdown").setup({
latex = { enabled = true },
latex = { enabled = false }, -- mdmath.nvim renders math as images
code = { inline_pad = 0, highlight_inline = "RenderMarkdownCode" },
})
require("mdmath").setup({
dynamic_scale = 0.5,
})
-- Rebuild mdmath JS deps on plugin update
vim.api.nvim_create_autocmd("PackChanged", {
callback = function(ev)
if ev.data.spec.name == "mdmath.nvim" and ev.data.kind == "update" then
vim.system({ "npm", "install" }, { cwd = ev.data.path .. "/mdmath-js" })
end
end,
})
vim.api.nvim_create_autocmd("FileType", {
pattern = "markdown",
callback = function(ev)