Clean up my previous updates
This commit is contained in:
parent
bad751197a
commit
9d4e33c775
|
@ -122,7 +122,7 @@ define-command -hidden d-indent-on-new-line %~
|
|||
# indent after if|else|while|for
|
||||
try %[ execute-keys -draft <semicolon><a-F>)MB <a-k> \A(if|else|while|for)\h*\(.*\)\h*\n\h*\n?\z <ret> s \A|.\z <ret> 1<a-&>1<a-space><a-gt> ]
|
||||
# deindent closing brace(s) when after cursor
|
||||
try %[ execute-keys -draft <a-x> <a-k> ^\h*[})]+\h*\;?\h*(?://.*)?$ <ret> \; <a-/> [})] <ret> m <a-S> 1<a-&> ]
|
||||
try %[ execute-keys -draft <a-x> <a-k> ^\h*[})] <ret> gh / [})] <ret> m <a-S> 1<a-&> ]
|
||||
=
|
||||
~
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ define-command -hidden json-indent-on-new-line %<
|
|||
# indent after lines ending with opener token
|
||||
try %< execute-keys -draft k <a-x> <a-k> [[{]\h*$ <ret> j <a-gt> >
|
||||
# deindent closer token(s) when after cursor
|
||||
try %< execute-keys -draft <a-x> <a-k> ^\h*[}\]]+ <ret> \; gh / [}\]] <ret> m <a-S> 1<a-&> >
|
||||
try %< execute-keys -draft <a-x> <a-k> ^\h*[}\]] <ret> gh / [}\]] <ret> m <a-S> 1<a-&> >
|
||||
>
|
||||
>
|
||||
|
||||
|
|
|
@ -101,9 +101,9 @@ define-command -hidden kak-indent-on-new-line %~
|
|||
# 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*(?:\h#.*)?$<ret> <a-/> <c-r>1 <ret> m <a-S> 1<a-&> _
|
||||
try %_ execute-keys -draft -itersel <a-x> <a-k> ^\h*([>)}\]]) <ret> gh / <c-r>1 <ret> m <a-S> 1<a-&> _
|
||||
# deindent closing char(s)
|
||||
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-&> }
|
||||
try %{ execute-keys -draft -itersel <a-x> <a-k> ^\h*([^\s\w]) <ret> gh / <c-r>1 <ret> <a-?> <c-r>1 <ret> <a-T>% <a-k> \w*<c-r>1$ <ret> <a-S> 1<a-&> }
|
||||
=
|
||||
~
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ define-command -hidden latex-indent-newline %(
|
|||
# indent after line ending with {
|
||||
try %( execute-keys -draft k<a-x> <a-k>\{$<ret> j<a-gt> )
|
||||
# deindent closing brace(s) when after cursor
|
||||
try %( execute-keys -draft <a-x> <a-k>^\h*\}+\h*(?:%.*)?$<ret> <a-/> \} <ret> m <a-S> 1<a-&> )
|
||||
try %( execute-keys -draft <a-x> <a-k> ^\h*\} <ret> gh / \} <ret> m <a-S> 1<a-&> )
|
||||
# indent after line ending with \begin{...}[...]{...}, with multiple
|
||||
# sets of arguments possible
|
||||
try %(
|
||||
|
|
|
@ -118,7 +118,7 @@ define-command -hidden perl-indent-on-new-line %~
|
|||
# indent after if|else|while|for
|
||||
try %[ execute-keys -draft <semicolon><a-F>)MB <a-k> \A(if|else|while|for)\h*\(.*\)\h*\n\h*\n?\z <ret> s \A|.\z <ret> 1<a-&>1<a-space><a-gt> ]
|
||||
# deindent closing brace(s) when after cursor
|
||||
try %[ execute-keys -draft <a-x> <a-k>^\h*[})]+\h*(?:#.*)?$<ret> \; <a-/> [})] <ret> m <a-S> 1<a-&> ]
|
||||
try %[ execute-keys -draft <a-x> <a-k> ^\h*[})] <ret> gh / [})] <ret> m <a-S> 1<a-&> ]
|
||||
=
|
||||
~
|
||||
|
||||
|
|
|
@ -94,7 +94,7 @@ define-command -hidden php-indent-on-new-line %<
|
|||
# append " * " on lines starting a multiline /** or /* comment
|
||||
try %{ execute-keys -draft k <a-x> s ^\h*/[*][* ]? <ret> j gi i <space>*<space> }
|
||||
# deindent closer token(s) when after cursor
|
||||
try %_ execute-keys -draft <a-x> <a-k>^\h*[})]+\h*(?://.*)?$<ret> \; <a-/> [})] <ret> m <a-S> 1<a-&> _
|
||||
try %_ execute-keys -draft <a-x> <a-k> ^\h*[})] <ret> gh / [})] <ret> m <a-S> 1<a-&> _
|
||||
>
|
||||
>
|
||||
|
||||
|
|
|
@ -113,7 +113,7 @@ define-command -hidden rust-indent-on-new-line %~
|
|||
# dedent after lines starting with . and ending with , or ;
|
||||
try %_ execute-keys -draft k <a-x> <a-k> ^\h*\..*[,<semicolon>]\h*$ <ret> j <a-lt> _
|
||||
# deindent closing brace(s) when after cursor
|
||||
try %= execute-keys -draft <a-x> <a-k> ^\h*[})]+\h*$ <ret> \; <a-/> [})] <ret> m <a-S> 1<a-&> =
|
||||
try %= execute-keys -draft <a-x> <a-k> ^\h*[})] <ret> gh / [})] <ret> m <a-S> 1<a-&> =
|
||||
# todo dedent additional unmatched parenthesis
|
||||
# try %& execute-keys -draft k <a-x> s \((?:[^)(]+|\((?:[^)(]+|\([^)(]*\))*\))*\) l Gl s\) %sh{
|
||||
# count previous selections length
|
||||
|
|
Loading…
Reference in New Issue
Block a user