AutoYADM commit: 2025-05-15 16:36:26
This commit is contained in:
parent
aaa2694df0
commit
13b7225f37
1 changed files with 39 additions and 16 deletions
|
@ -22,3 +22,26 @@ hook global WinSetOption filetype=kdl %{
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
provide-module kdl %~
|
||||||
|
|
||||||
|
define-command -hidden kdl-indent-newline %(
|
||||||
|
evaluate-commands -no-hooks -draft -itersel %(
|
||||||
|
# preserve prev line indent
|
||||||
|
try %{ execute-keys -draft K<a-&> }
|
||||||
|
# rem trailing whitespace on prev line
|
||||||
|
try %( execute-keys -draft kx <a-k>\{$<ret> j<a-gt> )
|
||||||
|
|
||||||
|
# deindent if next line start with {
|
||||||
|
try %( execute-keys -draft x <a-k> ^\h*\} <ret> gh / \} <ret> m <a-S> 1<a-&> )
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
define-command -hidden kdl-indent-closing-brace %(
|
||||||
|
evaluate-commands -no-hooks -draft -itersel %(
|
||||||
|
#align closing brace to block start
|
||||||
|
try %( execute_keys -draft x_ <a-k>^\h*\}\z<ret> m<a-S>1<a-&> )
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
~
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue