AutoYADM commit: 2025-05-23 17:40:15

This commit is contained in:
Daniel Fichtinger 2025-05-23 17:40:15 -04:00
parent 81ee9c4efd
commit b5df8717ab
2 changed files with 26 additions and 26 deletions

View file

@ -1,22 +1,22 @@
provide-module kdl %~ provide-module kdl %~
define-command -hidden kdl-indent-newline %( # define-command -hidden kdl-indent-newline %(
evaluate-commands -no-hooks -draft -itersel %( # evaluate-commands -no-hooks -draft -itersel %(
# preserve prev line indent # # preserve prev line indent
try %{ execute-keys -draft K<a-&> } # try %{ execute-keys -draft K<a-&> }
# rem trailing whitespace on prev line # # rem trailing whitespace on prev line
try %( execute-keys -draft kx <a-k>\{$<ret> j<a-gt> ) # try %( execute-keys -draft kx <a-k>\{$<ret> j<a-gt> )
# deindent if next line start with { # # deindent if next line start with {
try %( execute-keys -draft x <a-k> ^\h*\} <ret> gh / \} <ret> m <a-S> 1<a-&> ) # try %( execute-keys -draft x <a-k> ^\h*\} <ret> gh / \} <ret> m <a-S> 1<a-&> )
) # )
) # )
define-command -hidden kdl-indent-closing-brace %| # define-command -hidden kdl-indent-closing-brace %|
#align closing brace to block start # #align closing brace to block start
# try %= execute-keys -draft x_ <a-k>^\h*\}\z<ret> m<a-S>1<a-&> = # # try %= execute-keys -draft x_ <a-k>^\h*\}\z<ret> m<a-S>1<a-&> =
try %= execute-keys -draft -itersel <a-h><a-k>^\h*\Q %val{hook_param} \E$<ret> mGi s \A|.\z<ret> 1<a-&> = # try %= execute-keys -draft -itersel <a-h><a-k>^\h*\Q %val{hook_param} \E$<ret> mGi s \A|.\z<ret> 1<a-&> =
| # |
define-command -hidden kdl-indent-on-new-line %< define-command -hidden kdl-indent-on-new-line %<
evaluate-commands -draft -itersel %< evaluate-commands -draft -itersel %<
@ -41,7 +41,7 @@ hook global BufCreate .*[.](kdl) %{
# set-option window formatcmd "kdlfmt format -" # set-option window formatcmd "kdlfmt format -"
} }
hook global WinSetOption filetype=kdl %| hook global WinSetOption filetype=kdl %<
require-module kdl require-module kdl
# hook window InsertChar \n -group kdl-indent %{ kdl-indent-newline } # hook window InsertChar \n -group kdl-indent %{ kdl-indent-newline }
@ -52,12 +52,12 @@ hook global WinSetOption filetype=kdl %|
hook -once -always window WinSetOption filetype=.* %{ remove-hooks window kdl-indent } hook -once -always window WinSetOption filetype=.* %{ remove-hooks window kdl-indent }
hook -group kdl-auto-format window BufWritePre .* format # hook -group kdl-auto-format window BufWritePre .* format
hook -once -always WinSetOption filetype=.* %sh{ # hook -once -always WinSetOption filetype=.* %sh{
if [ "$kak_opt_filetype" != "kdl" ]; then # if [ "$kak_opt_filetype" != "kdl" ]; then
echo "unset-option window formatcmd" # echo "unset-option window formatcmd"
echo "remove-hooks window kdl-auto-format" # echo "remove-hooks window kdl-auto-format"
fi # fi
} # }
| >

View file

@ -19,8 +19,8 @@ bundle inc-dec.kak https://gitlab.com/Screwtapello/kakoune-inc-dec %{
map -docstring "decrement" global normal <c-x> %{: inc-dec-modify-numbers - %val{count}<ret>} map -docstring "decrement" global normal <c-x> %{: inc-dec-modify-numbers - %val{count}<ret>}
} }
bundle auto-pairs.kak https://github.com/alexherbo2/auto-pairs.kak %{ bundle-noload auto-pairs.kak https://github.com/alexherbo2/auto-pairs.kak %{
# enable-auto-pairs enable-auto-pairs
} }
bundle-noload fzf.kak https://github.com/andreyorst/fzf.kak %{ bundle-noload fzf.kak https://github.com/andreyorst/fzf.kak %{