AutoYADM commit: 2025-06-01 15:14:18
This commit is contained in:
parent
a6f8a34346
commit
c161905eaa
3 changed files with 25 additions and 3 deletions
|
@ -1 +0,0 @@
|
||||||
|
|
|
@ -2,6 +2,29 @@ hook global WinSetOption filetype=markdown %{
|
||||||
set-option window formatcmd "dprint fmt --stdin md"
|
set-option window formatcmd "dprint fmt --stdin md"
|
||||||
hook -group markdown-auto-format window BufWritePre .* format
|
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=.* %{
|
# hook -once -always WinSetOption filetype=.* %{
|
||||||
# unset-option window formatcmd
|
# unset-option window formatcmd
|
||||||
# remove-hooks window markdown-auto-format
|
# remove-hooks window markdown-auto-format
|
||||||
|
|
|
@ -3,8 +3,8 @@ root = true
|
||||||
[*]
|
[*]
|
||||||
charset = utf-8
|
charset = utf-8
|
||||||
end_of_line = lf
|
end_of_line = lf
|
||||||
insert_final_newline = true
|
; insert_final_newline = true
|
||||||
trim_training_whitespace = true
|
; trim_trailing_whitespace = true
|
||||||
indent_style=space
|
indent_style=space
|
||||||
indent_size=4
|
indent_size=4
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue