Skip to content

About

A Markdown rendering engine for Neovim — rich formatting, tables, images, video, Mermaid diagrams

Topics

Resources

Stars

240 stars

Watchers

1 watching

Forks

Repository files navigation

md-render.nvim

日本語版はこちら / Japanese version

A Markdown renderer for Neovim that runs entirely in the terminal. It shows a Markdown buffer — images, video, and diagrams included — in a floating window, a tab, a split beside the source, in place of the source, or as a less-like pager, and leaves the buffer you edit untouched.

md-render.nvim showcase: inline formatting, tables, callouts, code blocks, images, video, and Mermaid diagrams

Features

  • Markdown, fully rendered — inline formatting, tables, GitHub / Obsidian callouts, <details>, and code blocks highlighted by treesitter. Callouts, <details>, and truncated code blocks and tables fold and expand with <CR> or a click
  • Images and video — PNG, JPEG, WebP, GIF, and MP4 / WebM / MOV, local or from the web, drawn inline with the Kitty graphics protocol
  • Diagrams — Mermaid and PlantUML fences rendered as images
  • Zoom — <CR> or a click on an image, a video, or a diagram enlarges it to fill the editor. A Mermaid diagram is drawn again at that size, so its text stays sharp
  • Links — click to open, hover to see the full URL, OSC 8 hyperlinks
  • Japanese and other CJK text — JIS X 4051 line breaking, optional BudouX phrase breaking, and no stray spaces between joined lines
  • Scaled headings (experimental, Kitty only) — headings drawn larger with the text sizing protocol
  • Picker previews — for telescope.nvim and snacks.nvim
  • Library API — use the rendering engine from your own plugin
md-render-zoom.mp4

Requirements

Installation

With lazy.nvim:

{
  "delphinus/md-render.nvim",
  version = "*",
  dependencies = {
    { "nvim-tree/nvim-web-devicons", version = "*" }, -- optional
    { "delphinus/budoux.lua", version = "*" }, -- optional
  },
  keys = {
    { "<leader>mp", "<Plug>(md-render-preview)", desc = "Markdown preview (toggle)" },
    { "<leader>mt", "<Plug>(md-render-preview-tab)", desc = "Markdown preview in tab (toggle)" },
  },
}

The plugin sets no key mappings of its own. For vim.pack and mini.deps, see :help md-render-installation.

Quick start

To see every feature, open the showcase bundled with the plugin in the pager, or run :MdRender demo:

git clone https://github.com/delphinus/md-render.nvim
nvim +"MdRender pager" md-render.nvim/assets/showcase.md
Command Shows the current Markdown buffer
:MdRender in a floating window
:MdRender tab in a new tab
:MdRender split in a split beside the source; edits and the cursor follow live
:MdRender toggle in place of the source, in the same window
:MdRender pager full screen; q quits Neovim

In a preview:

Key Action
<CR> Enlarge the image, or fold / expand the block, under the cursor
click Enlarge an image, fold / expand a block, or open a link
za Fold / expand the block under the cursor
q / <Esc> Close the floating window or tab

Documentation

Everything else is in the help: all commands and options, rendering width, the experimental features, picker integration, the Lua API, highlight groups, and troubleshooting.

Development

make test runs the tests. See tests/README.md for the other test layers.

License

MIT — see LICENSE.

lua/md-render/vendor/ is third-party code kept verbatim under its own license: a copy of Neovim's vim.async (Apache-2.0), which gives Neovim 0.12 the async runtime 0.13 has built in. See its README.

About

A Markdown rendering engine for Neovim — rich formatting, tables, images, video, Mermaid diagrams

Topics

Resources

Stars

240 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages