Skip to content

goropikari/plantuml.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

plantuml.nvim

A Neovim plugin for generating and previewing PlantUML diagrams directly within Neovim. This plugin allows users to preview ASCII representations of diagrams and export them to various formats (e.g., PNG, SVG).

demo gif

Features

  • Render PlantUML diagrams as ASCII in a window within Neovim.
  • Export diagrams to specified formats (PNG, SVG, etc.).
  • Automatic preview reload on file save events.
  • Configurable viewer for image exports.

Requirements

  • curl: for downloading the generated diagrams.

Installation

lazy.nvim

  {
    'goropikari/plantuml.nvim',
    dependencies = {
      'goropikari/LibDeflate.nvim',
    },
    opts = {
      -- default opts
      base_url = 'https://www.plantuml.com/plantuml',
      reload_events = { 'BufWritePre' },
      viewer = 'xdg-open', -- Image viewer for non-ASCII exports
      docker_image = 'plantuml/plantuml-server:tomcat'
    },
  },

Usage

Commands

  • :PlantumlPreview [format]: Preview the diagram in ASCII or export it to a specified format.
    • :PlantumlPreview ascii: Preview the ASCII rendering in a floating window.
    • :PlantumlPreview png: Export the diagram as a PNG file and open it with the specified viewer.
    • Supports PNG, SVG, and other formats.
  • :PlantumlExport [format] [path]: Export the current diagram to a specified format and path.
    • :PlantumlExport png ~/diagrams/diagram.png: Export as PNG to ~/diagrams/diagram.png.
    • :PlantumlExport svg: Export as SVG and print the path in Neovim.
  • :PlantumlStartDocker: Start plantuml container.

Alternative

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published