Skip to content

mnemnion/nvim-pikchr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nvim-pikchr

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.

Install

With Lazy:

{
  'mnemnion/nvim-pikchr',
  opts = {}, -- Same as config options below
}

Configuration

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 to false.
  • 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.

About

Neovim package for Pikchr diagrams

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages