You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
D2 files are automatically formatted on save using d2 fmt. This can be configured:
" Enable/disable auto format on save (default: 1)letg:d2_fmt_autosave=1" Customize the format command (default: "d2 fmt")letg:d2_fmt_command="d2 fmt"" Fail silently when formatting fails (default: 0)letg:d2_fmt_fail_silently=0
Commands:
:D2Fmt - Format current buffer
:D2FmtToggle - Toggle auto format on save
Validation
D2 files can be validated using d2 validate. This can be configured:
" Enable/disable auto validate on save (default: 0)letg:d2_validate_autosave=0" Customize the validate command (default: "d2 validate")letg:d2_validate_command="d2 validate"" Use quickfix or locationlist for errors (default: "quickfix")letg:d2_list_type="quickfix"" Fail silently when validation fails (default: 0)letg:d2_validate_fail_silently=0
Commands:
:D2Validate - Validate current buffer
:D2ValidateToggle - Toggle auto validate on save
Playground
Open D2 files in the online playground at play.d2lang.com. This
is useful for an ad-hoc way of sharing your d2 diagram with someone.
" Customize the play command (default: "d2 play")letg:d2_play_command="d2 play"" Set the theme ID (default: 0)letg:d2_play_theme=0" Enable sketch mode (default: 0)letg:d2_play_sketch=0
Commands:
:D2Play - Open current buffer in D2 playground
Documentation
See :help d2-vim or ./doc/d2.txt for options and additional documentation.