Major mode for PlantUML files.
Supports
- Xref navigation of component definitions & references
- Generating png preview files using the plantuml jar & java
Adds the following keybindings
Keybinding | Feature |
---|---|
C-c C-c | Compile diagram to check for errors |
C-c C-p | Generate diagram preview |
C-c C-o | Generate diagram preview & open in external image viewer |
C-c ! | Select diagram type when starting a diagram |
C-c i | Insert a deployment diagram element with automatic alias generated |
C-u C-c i | Insert diagram element with prompt for alias |
M-<up> | Move line up |
M-<down> | Move line down |
C-c c | Insert transparent rectangle container with dashed (Use C-u for dotted, C-u C-u for box) |
C-j | Expand special like emmet mode (Alternate C-<return>). Use C-u for dashed & C-u C-u for dotted |
While there is already an excellent plantuml-mode available what is the reason of this package existing?
- Did not like
planutml-init
loading language keywords for each session - Did not like preview buffer popping up new window distracting the diagramming session
- Wanted errors in plantuml compilation to be easily accessible via the compilation-mode
- Wanted quick creation of plantuml diagram components
- Wanted jump-to-definition & list-references within the file
-
Imenu listings for component definitions
-
Simple emmet-mode like completions for relationships eg.
a->b,c->d
expands toa --> b b --> c b --> d c --> d
-
Ensure a compatible Java Runtime Environment (JRE) is installed
-
Install the latest PlantUML jar file from https://github.com/plantuml/plantuml
-
Clone the repository into site-lisp in the emacs user directory
git clone https://github.com/xshyamx/simple-plantuml-mode \ $HOME/.emacs.d/site-lisp/simple-plantuml-mode
-
Add to
load-path
(add-to-list 'load-path (expand-file-name "site-lisp/simple-plantuml-mode" user-emacs-directory))
-
Load & configure
(require 'plantuml-mode) (setq plantuml-java-cmd "java" plantuml-jar-path (expand-file-name "~/.m2/repository/net/sourceforge/plantuml/plantuml/1.2022.12/plantuml-1.2022.12.jar"))