AutoYADM commit: 2025-06-19 18:50:14

This commit is contained in:
Daniel Fichtinger 2025-06-19 18:50:15 -04:00
parent 5d6d0a5918
commit b88e22eafa

View file

@ -4,14 +4,25 @@ hook global BufCreate .+[.](mmd|mermaid) %{
hook global WinSetOption filetype=mermaid %{
require-module mermaid
hook window InsertChar \n -group mermaid-indent mermaid-indent-on-new-line
hook window ModeChange pop:insert:.* -group mermaid-trim-indent mermaid-trim-indent
hook -once -always window WinSetOption filetype=.* %{ remove-hooks window mermaid-.+ }
set-option window indentwidth 2
set-option window comment_line '%%'
}
provide-module mermaid %—
# TODO: regex highlighting (treesitter is overkill lol)
define-command -hidden mermaid-indent-on-new-line %~
# preserve prev line indent
try %{ execute-keys -draft <semicolon> K <a-&> }
~
define-command -hidden mermaid-trim-indent %{
# rm trailing whitespace
try %{ execute-keys -draft -itersel x s \h+$ <ret> d }
}