Skip to main content

Vim plugin

D2 has an official, creator-maintained plugin for Vim. You can use any plugin manager to include terrastruct/d2-vim. For example:

Automatic indentation and syntax highlighting are fully supported and make working with the D2 language far more pleasant. Autoformat on each save is planned.

The syntax highlighting will even catch basic errors for you if your color theme highlights illegal syntax.

Github: https://github.com/terrastruct/d2-vim