AutoYADM commit: 2025-05-23 14:50:15

This commit is contained in:
Daniel Fichtinger 2025-05-23 14:50:15 -04:00
parent e20e01dc62
commit 057da1d133

View file

@ -1,28 +1,3 @@
hook global BufCreate .*[.](kdl) %{
set-option buffer filetype kdl
set-option buffer comment_line "//"
set-option buffer comment_block_begin "/*"
set-option buffer comment_block_end "*/"
set-option window formatcmd "kdlfmt format -"
}
hook global WinSetOption filetype=kdl %{
require-module kdl
# hook window InsertChar \n -group kdl-indent %{ kdl-indent-newline }
# hook window InsertChar \} -group kdl-indent %{ kdl-indent-closing-brace }
hook -once -always window WinSetOption filetype=.* %{ remove-hooks window kdl-indent }
hook -group kdl-auto-format window BufWritePre .* format
hook -once -always WinSetOption filetype=.* %sh{
if [ "$kak_opt_filetype" != "kdl" ]; then
echo "unset-option window formatcmd"
echo "remove-hooks window kdl-auto-format"
fi
}
}
provide-module kdl %~ provide-module kdl %~
define-command -hidden kdl-indent-newline %( define-command -hidden kdl-indent-newline %(
@ -45,3 +20,29 @@ define-command -hidden kdl-indent-closing-brace %(
) )
~ ~
hook global BufCreate .*[.](kdl) %{
set-option buffer filetype kdl
set-option buffer comment_line "//"
set-option buffer comment_block_begin "/*"
set-option buffer comment_block_end "*/"
set-option window formatcmd "kdlfmt format -"
}
hook global WinSetOption filetype=kdl %{
require-module kdl
hook window InsertChar \n -group kdl-indent %{ kdl-indent-newline }
hook window InsertChar \} -group kdl-indent %{ kdl-indent-closing-brace }
hook -once -always window WinSetOption filetype=.* %{ remove-hooks window kdl-indent }
hook -group kdl-auto-format window BufWritePre .* format
hook -once -always WinSetOption filetype=.* %sh{
if [ "$kak_opt_filetype" != "kdl" ]; then
echo "unset-option window formatcmd"
echo "remove-hooks window kdl-auto-format"
fi
}
}