AutoYADM commit: 2025-06-19 18:50:14
This commit is contained in:
parent
5d6d0a5918
commit
b88e22eafa
1 changed files with 11 additions and 0 deletions
|
@ -4,14 +4,25 @@ hook global BufCreate .+[.](mmd|mermaid) %{
|
||||||
|
|
||||||
hook global WinSetOption filetype=mermaid %{
|
hook global WinSetOption filetype=mermaid %{
|
||||||
require-module 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 indentwidth 2
|
||||||
set-option window comment_line '%%'
|
set-option window comment_line '%%'
|
||||||
}
|
}
|
||||||
|
|
||||||
provide-module mermaid %—
|
provide-module mermaid %—
|
||||||
|
# TODO: regex highlighting (treesitter is overkill lol)
|
||||||
define-command -hidden mermaid-indent-on-new-line %~
|
define-command -hidden mermaid-indent-on-new-line %~
|
||||||
# preserve prev line indent
|
# preserve prev line indent
|
||||||
try %{ execute-keys -draft <semicolon> K <a-&> }
|
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 }
|
||||||
|
}
|
||||||
—
|
—
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue