AutoYADM commit: 2025-05-15 16:21:01
This commit is contained in:
parent
3c113d9d89
commit
aaa2694df0
1 changed files with 19 additions and 1 deletions
|
@ -2,5 +2,23 @@ hook global BufCreate .*[.](kdl) %{
|
||||||
set-option buffer filetype kdl
|
set-option buffer filetype kdl
|
||||||
set-option buffer comment_line "//"
|
set-option buffer comment_line "//"
|
||||||
set-option buffer comment_block_begin "/*"
|
set-option buffer comment_block_begin "/*"
|
||||||
set-option buffer comment_block_ "*/"
|
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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue