Merge branch 'deindent-closing-braces' into HEAD

This commit is contained in:
John Isom 2020-07-29 08:55:48 -06:00
commit 1eb34996e1
2 changed files with 4 additions and 4 deletions

View File

@ -101,9 +101,9 @@ define-command -hidden kak-indent-on-new-line %~
# indent after line ending with %\w*[^\s\w] # indent after line ending with %\w*[^\s\w]
try %{ execute-keys -draft k <a-x> <a-k> \%\w*[^\s\w]$ <ret> j <a-gt> } try %{ execute-keys -draft k <a-x> <a-k> \%\w*[^\s\w]$ <ret> j <a-gt> }
# deindent closing brace when after cursor # deindent closing brace when after cursor
try %_ execute-keys -draft <a-x> <a-k>^\h*[>)}\]]\h*$<ret> hm <a-S> 1<a-&> _ try %_ execute-keys -draft -itersel <a-x> <a-k>^\h*([>)}\]])\h*(?:\h#.*)?$<ret> <a-/> <c-r>1 <ret> m <a-S> 1<a-&> _
# deindent closing char(s) # deindent closing char(s)
try %{ execute-keys -draft -itersel <a-x> <a-k>^\h*([^\s\w])\h*$<ret> h <a-?><c-r>1<ret> <a-T>% <a-k>\w*<c-r>1$<ret> <a-S> 1<a-&> } try %{ execute-keys -draft -itersel <a-x> <a-k>^\h*([^\s\w])\h*(?:\h#.*)?$<ret> <a-/><c-r>1<ret> <a-?><c-r>1<ret> <a-T>% <a-k>\w*<c-r>1$<ret> <a-S> 1<a-&> }
= =
~ ~

View File

@ -111,8 +111,8 @@ define-command -hidden perl-indent-on-new-line %~
try %{ execute-keys -draft k<a-x> s \h+$ <ret>d } try %{ execute-keys -draft k<a-x> s \h+$ <ret>d }
# align to opening paren of previous line # align to opening paren of previous line
try %{ execute-keys -draft [( <a-k> \A\([^\n]+\n[^\n]*\n?\z <ret> s \A\(\h*.|.\z <ret> '<a-;>' & } try %{ execute-keys -draft [( <a-k> \A\([^\n]+\n[^\n]*\n?\z <ret> s \A\(\h*.|.\z <ret> '<a-;>' & }
# copy // comments prefix # copy # comments prefix
try %{ execute-keys -draft <semicolon><c-s>k<a-x> s ^\h*\K/{2,} <ret> y<c-o>P<esc> } try %{ execute-keys -draft <semicolon><c-s>k<a-x> s ^\h*\K# <ret> y<c-o>P<esc> }
# indent after a switch's case/default statements # indent after a switch's case/default statements
try %[ execute-keys -draft k<a-x> <a-k> ^\h*(case|default).*:$ <ret> j<a-gt> ] try %[ execute-keys -draft k<a-x> <a-k> ^\h*(case|default).*:$ <ret> j<a-gt> ]
# indent after if|else|while|for # indent after if|else|while|for