neitomic

My markdown preview server

Jul 11, 2026

I’m working a lot with LLM agents lately and keeping a lot of markdown documents in the repository. Those are agent instructions, notes, ADRs, documents,…

I’d like to have rich formatting like diagrams, tables, code snippets,… in my documents, and the markdown viewer in IDEs not supporting all the things I want, and there is something that make me not comfortable reading in there.

The markdown preview in side neovim is good, but not supporting mermaid diagrams.

So I made one for myself. It is here neitomic/mdprev

Some highlight features:

Adding into my lazyvim config

lua/config/keymaps.lua

local mdprev_job = nil
local function toggle_markserv()
  if mdprev_job then
    vim.fn.jobstop(mdprev_job)
    mdprev_job = nil
    vim.notify("mdprev stopped")
    return
  end
  mdprev_job = vim.fn.jobstart({ "mdprev", "-o", "-q",  vim.fn.getcwd() })
  vim.notify("mdprev serving " .. vim.fn.getcwd())
end
vim.api.nvim_create_user_command("MarkdownFolder", toggle_markserv, {})
vim.keymap.set("n", "<leader>mm", toggle_markserv, { desc = "Toggle mdprev (folder markdown preview)" })