A Neovim package for Pikchr diagrams.
Based on vim pikchr by Lifepillar, adapted for Neovim, with pikchresque-specific features. These are turned off by default: this is intended to be a fully-functional plugin for 'stock' Pikchr as well.
It has the basics: filetype detection, indents, syntax highlighting, and so on. It also comes with a diagram preview server.
This plugin expects that pikchr is somewhere on your $PATH, although
that can be configured.
With Lazy:
{
'mnemnion/nvim-pikchr',
opts = {}, -- Same as config options below
}require("nvim-pikchr").setup({
pikchresque = false,
preview = {
auto_start = false,
pikchr_cmd = "pikchr",
pikchr_args = { "--dont-stop", "-" },
host = "127.0.0.1",
port = 9123,
open_browser = true,
refresh_ms = 500,
dark_mode = false,
},
})Options:
pikchresque: enable Pikchresque-specific behavior. Defaults tofalse.preview: configure the native Neovim browser preview.auto_start: start the server when a Pikchr buffer is loaded.open_browser: open the default browser when the server starts.
Preview commands:
:PikchrPreviewStart: start a loopback HTTP server, render the current buffer, open the browser when configured, and re-render after each save.:PikchrPreviewStop: stop the preview server.:PikchrPreviewOpen: open the current preview URL.:PikchrPreviewRender: render the current buffer without waiting for a save.:PikchrPreviewStatus: show the preview server URL and render revision.