AutoYADM commit: 2025-06-01 15:14:18

This commit is contained in:
Daniel Fichtinger 2025-06-01 15:14:18 -04:00
parent a6f8a34346
commit c161905eaa
3 changed files with 25 additions and 3 deletions

View file

@ -1 +0,0 @@

View file

@ -2,6 +2,29 @@ hook global WinSetOption filetype=markdown %{
set-option window formatcmd "dprint fmt --stdin md"
hook -group markdown-auto-format window BufWritePre .* format
# override formatting commands
define-command -override -hidden markdown-trim-indent %{
evaluate-commands -no-hooks -draft -itersel %{
execute-keys x
# remove trailing white spaces
# try %{ execute-keys -draft s \h + $ <ret> d }
}
}
define-command -override -hidden markdown-insert-on-new-line %{
try %{ execute-keys -draft -itersel k x s ^\h*\K((>\h*)+([*+-]\h)?|(>\h*)*[*+-]\h)\h* <ret> y gh j P }
}
define-command -override -hidden markdown-indent-on-new-line %{
evaluate-commands -draft -itersel %{
# preserve previous line indent
try %{ execute-keys -draft <semicolon> K <a-&> }
# remove trailing white spaces
# try %{ execute-keys -draft k x s \h+$ <ret> d }
}
}
# hook -once -always WinSetOption filetype=.* %{
# unset-option window formatcmd
# remove-hooks window markdown-auto-format

View file

@ -3,8 +3,8 @@ root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_training_whitespace = true
; insert_final_newline = true
; trim_trailing_whitespace = true
indent_style=space
indent_size=4