diff --git a/rc/filetype/kakrc.kak b/rc/filetype/kakrc.kak index 2a2f505f..951afb42 100644 --- a/rc/filetype/kakrc.kak +++ b/rc/filetype/kakrc.kak @@ -90,8 +90,8 @@ add-highlighter shared/kakrc/single_string/escape regex "''" 0:default+b # Commands # ‾‾‾‾‾‾‾‾ -define-command -hidden kak-indent-on-new-line %{ - evaluate-commands -draft -itersel %{ +define-command -hidden kak-indent-on-new-line %~ + evaluate-commands -draft -itersel %= # copy '#' comment prefix and following white spaces try %{ execute-keys -draft k s ^\h*#\h* y jgh P } # preserve previous line indent @@ -100,8 +100,10 @@ define-command -hidden kak-indent-on-new-line %{ try %{ execute-keys -draft k s \h+$ d } # indent after line ending with %\w*[^\s\w] try %{ execute-keys -draft k \%\w*[^\s\w]$ j } - } -} + # deindent closing brace when after cursor + try %_ execute-keys -draft -itersel ^\h*[>)}\]]\h*$ hm 1 _ + = +~ define-command -hidden kak-indent-on-closing-matching %~ # align to opening matching brace when alone on a line