summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Isom <John.Isom2001@gmail.com>2020-07-27 21:21:33 -0600
committerJohn Isom <John.Isom2001@gmail.com>2020-07-27 21:26:17 -0600
commitd818ff8ac0eb32c367e1e8a04fb5268ff5658a47 (patch)
tree047dd358a44fddbca7f22f9f90e2d36cf1b58406
parentfd3716a12b2715aacd68e6b6db3d44739c71d8ca (diff)
Fix indentation for closing braces in kakrc.kak
This fixes %{ }, %< > style, not %| |, %= =, etc
-rw-r--r--rc/filetype/kakrc.kak10
1 files changed, 6 insertions, 4 deletions
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 <a-x> s ^\h*#\h* <ret> y jgh P }
# preserve previous line indent
@@ -100,8 +100,10 @@ define-command -hidden kak-indent-on-new-line %{
try %{ execute-keys -draft k <a-x> s \h+$ <ret> d }
# indent after line ending with %\w*[^\s\w]
try %{ execute-keys -draft k <a-x> <a-k> \%\w*[^\s\w]$ <ret> j <a-gt> }
- }
-}
+ # deindent closing brace when after cursor
+ try %_ execute-keys -draft -itersel <a-x> <a-k>^\h*[>)}\]]\h*$<ret> hm <a-S> 1<a-&> _
+ =
+~
define-command -hidden kak-indent-on-closing-matching %~
# align to opening matching brace when alone on a line