Render diagrams from a
metacat
file from nvim.
Assumes metacat-cli is installed.
To configure using Lazy.nvim, add this to plugins.lua:
{
"statusfailed/metacat.nvim",
opts = {
viewer = { "svgtail" },
},
},
Then bind the render method to a key (e.g. F6 below) by adding the following to init.lua:
vim.keymap.set("n", "<F6>", require("metacat").render, { desc = "Metacat: render def-arrow as SVG" })
The configuration above uses svgtail to
render SVGs.
You can use other programs by setting the viewer opt, e.g. for feh:
viewer = { "feh", "--reload", "1" }
viewer should be a command which:
- Launches with the path to an SVG as its final argument
- Will auto-reload the file when the file path changes