AutoYADM commit: 2025-06-24 13:51:47
This commit is contained in:
parent
2cf674bb7e
commit
6264b1e53c
4 changed files with 77 additions and 15 deletions
|
@ -11,8 +11,64 @@ hook global WinSetOption filetype=python %{
|
|||
}
|
||||
}
|
||||
|
||||
hook global WinSetOption filetype=yaml %{
|
||||
set-option window formatcmd %{
|
||||
if dprint output-resolved-config >/dev/null 2>&1; then
|
||||
dprint fmt --stdin yaml
|
||||
else
|
||||
dprint fmt --stdin yaml --config "$HOME/.dprint.jsonc"
|
||||
fi
|
||||
}
|
||||
}
|
||||
|
||||
hook global WinSetOption filetype=html %{
|
||||
set-option window formatcmd %{
|
||||
if dprint output-resolved-config >/dev/null 2>&1; then
|
||||
dprint fmt --stdin html
|
||||
else
|
||||
dprint fmt --stdin html --config "$HOME/.dprint.jsonc"
|
||||
fi
|
||||
}
|
||||
}
|
||||
|
||||
hook global WinSetOption filetype=css %{
|
||||
set-option window formatcmd %{
|
||||
if dprint output-resolved-config >/dev/null 2>&1; then
|
||||
dprint fmt --stdin css
|
||||
else
|
||||
dprint fmt --stdin css --config "$HOME/.dprint.jsonc"
|
||||
fi
|
||||
}
|
||||
}
|
||||
|
||||
hook global WinSetOption filetype=json %{
|
||||
set-option window formatcmd %{
|
||||
if dprint output-resolved-config >/dev/null 2>&1; then
|
||||
dprint fmt --stdin json
|
||||
else
|
||||
dprint fmt --stdin json --config "$HOME/.dprint.jsonc"
|
||||
fi
|
||||
}
|
||||
}
|
||||
|
||||
hook global WinSetOption filetype=jsonc %{
|
||||
set-option window formatcmd %{
|
||||
if dprint output-resolved-config >/dev/null 2>&1; then
|
||||
dprint fmt --stdin jsonc
|
||||
else
|
||||
dprint fmt --stdin jsonc --config "$HOME/.dprint.jsonc"
|
||||
fi
|
||||
}
|
||||
}
|
||||
|
||||
hook global WinSetOption filetype=toml %{
|
||||
set-option window formatcmd "taplo fmt -"
|
||||
set-option window formatcmd %{
|
||||
if dprint output-resolved-config >/dev/null 2>&1; then
|
||||
dprint fmt --stdin toml
|
||||
else
|
||||
dprint fmt --stdin toml --config "$HOME/.dprint.jsonc"
|
||||
fi
|
||||
}
|
||||
# hook -group toml-auto-format window BufWritePre .* %{
|
||||
# try format
|
||||
# }
|
||||
|
|
|
@ -1,11 +1,14 @@
|
|||
hook global WinSetOption filetype=markdown %{
|
||||
# explicitly load to avoid race condition
|
||||
require-module markdown
|
||||
# set-option window formatcmd "dprint fmt --stdin md"
|
||||
set-option window formatcmd %{
|
||||
dprint fmt --stdin md || dprint fmt --stdin md --config '/home/fic/.dprint.jsonc' -L info
|
||||
if dprint output-resolved-config >/dev/null 2>&1; then
|
||||
dprint fmt --stdin md
|
||||
else
|
||||
dprint fmt --stdin md --config "$HOME/.dprint.jsonc"
|
||||
fi
|
||||
}
|
||||
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 %{
|
||||
|
|
|
@ -1,22 +1,21 @@
|
|||
{
|
||||
"markdown": {
|
||||
"lineWidth": 80,
|
||||
"textWrap": "always"
|
||||
"textWrap": "always",
|
||||
},
|
||||
"dockerfile": {},
|
||||
"markup": {},
|
||||
"excludes": [
|
||||
"**/node_modules",
|
||||
"**/*-lock.json"
|
||||
"**/*-lock.json",
|
||||
],
|
||||
"plugins": [
|
||||
// "https://plugins.dprint.dev/typescript-0.93.3.wasm",
|
||||
// "https://plugins.dprint.dev/json-0.19.4.wasm",
|
||||
"https://plugins.dprint.dev/markdown-0.17.8.wasm",
|
||||
// "https://plugins.dprint.dev/toml-0.6.4.wasm",
|
||||
"https://plugins.dprint.dev/dockerfile-0.3.2.wasm",
|
||||
"https://plugins.dprint.dev/markdown-0.19.0.wasm",
|
||||
"https://plugins.dprint.dev/dockerfile-0.3.3.wasm",
|
||||
"https://plugins.dprint.dev/g-plane/malva-v0.11.1.wasm",
|
||||
"https://plugins.dprint.dev/g-plane/markup_fmt-v0.18.0.wasm",
|
||||
"https://plugins.dprint.dev/g-plane/pretty_yaml-v0.5.0.wasm"
|
||||
]
|
||||
"https://plugins.dprint.dev/g-plane/markup_fmt-v0.22.0.wasm",
|
||||
"https://plugins.dprint.dev/g-plane/pretty_yaml-v0.5.1.wasm",
|
||||
"https://plugins.dprint.dev/json-0.20.0.wasm",
|
||||
"https://plugins.dprint.dev/toml-0.7.0.wasm",
|
||||
],
|
||||
}
|
|
@ -8,6 +8,10 @@ end_of_line = lf
|
|||
# indent_style=space
|
||||
# indent_size=4
|
||||
|
||||
[*.{json,jsonc}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.py]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue