mirror of
https://github.com/mawww/kakoune.git
synced 2024-11-10 13:25:25 +03:00
parent
6e08716899
commit
95c1d25f28
20
rc/json.kak
20
rc/json.kak
@ -30,23 +30,23 @@ def -hidden _json_filter_around_selections %{
|
||||
try %{ exec -draft -itersel <a-x> s \h+$ <ret> d }
|
||||
}
|
||||
|
||||
def -hidden _json_indent_on_char "
|
||||
eval -draft -itersel %_
|
||||
def -hidden _json_indent_on_char %<
|
||||
eval -draft -itersel %<
|
||||
# align closer token to its opener when alone on a line
|
||||
try %/ exec -draft <a-h> <a-k> ^\h+[]}]$ <ret> m s \`|.\' <ret> 1<a-&> /
|
||||
_
|
||||
"
|
||||
try %< exec -draft <a-h> <a-k> ^\h+[]}]$ <ret> m s \`|.\' <ret> 1<a-&> >
|
||||
>
|
||||
>
|
||||
|
||||
def -hidden _json_indent_on_new_line "
|
||||
eval -draft -itersel '
|
||||
def -hidden _json_indent_on_new_line %<
|
||||
eval -draft -itersel %<
|
||||
# preserve previous line indent
|
||||
try %{ exec -draft <space> K <a-&> }
|
||||
# filter previous line
|
||||
try %{ exec -draft k : _json_filter_around_selections <ret> }
|
||||
# indent after lines beginning with opener token
|
||||
try %_ exec -draft k x <a-k> ^\h*[[{] <ret> j <a-gt> _
|
||||
'
|
||||
"
|
||||
try %< exec -draft k x <a-k> ^\h*[[{] <ret> j <a-gt> >
|
||||
>
|
||||
>
|
||||
|
||||
# Initialization
|
||||
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾
|
||||
|
22
rc/ragel.kak
22
rc/ragel.kak
@ -38,16 +38,16 @@ def -hidden _ragel_filter_around_selections %{
|
||||
try %{ exec -draft -itersel <a-x> s \h+$ <ret> d }
|
||||
}
|
||||
|
||||
def -hidden _ragel_indent_on_char "
|
||||
eval -draft -itersel %_
|
||||
def -hidden _ragel_indent_on_char %<
|
||||
eval -draft -itersel %<
|
||||
# align closer token to its opener when alone on a line
|
||||
try %/ exec -draft <a-h> <a-k> ^\h+[]})]$ <ret> m s \`|.\' <ret> 1<a-&> /
|
||||
try %/ exec -draft <a-h> <a-k> ^\h+ [*]$ <ret> <a-?> [*]$ <ret> s \`|.\' <ret> 1<a-&> /
|
||||
_
|
||||
"
|
||||
try %< exec -draft <a-h> <a-k> ^\h+[]})]$ <ret> m s \`|.\' <ret> 1<a-&> >
|
||||
try %< exec -draft <a-h> <a-k> ^\h+ [*]$ <ret> <a-?> [*]$ <ret> s \`|.\' <ret> 1<a-&> >
|
||||
>
|
||||
>
|
||||
|
||||
def -hidden _ragel_indent_on_new_line "
|
||||
eval -draft -itersel '
|
||||
def -hidden _ragel_indent_on_new_line %<
|
||||
eval -draft -itersel %<
|
||||
# preserve previous line indent
|
||||
try %{ exec -draft <space> K <a-&> }
|
||||
# filter previous line
|
||||
@ -55,9 +55,9 @@ def -hidden _ragel_indent_on_new_line "
|
||||
# copy _#_ comment prefix and following white spaces
|
||||
try %{ exec -draft k x s ^\h*\K#\h* <ret> y j p }
|
||||
# indent after lines ending with opener token
|
||||
try %_ exec -draft k x <a-k> [[{(*]$ <ret> j <a-gt> _
|
||||
'
|
||||
"
|
||||
try %< exec -draft k x <a-k> [[{(*]$ <ret> j <a-gt> >
|
||||
>
|
||||
>
|
||||
|
||||
# Initialization
|
||||
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾
|
||||
|
20
rc/ruby.kak
20
rc/ruby.kak
@ -64,17 +64,17 @@ def -hidden _ruby_filter_around_selections %{
|
||||
try %{ exec -draft -itersel <a-x> s \h+$ <ret> d }
|
||||
}
|
||||
|
||||
def -hidden _ruby_indent_on_char "
|
||||
eval -draft -itersel %_
|
||||
def -hidden _ruby_indent_on_char %<
|
||||
eval -draft -itersel %<
|
||||
# deindent on (else|elsif|end|rescue|when) keyword insertion
|
||||
try %{ exec -draft <space> <a-i>w <a-k> (else|elsif|end|rescue|when) <ret> <a-lt> }
|
||||
# align closer token to its opener when alone on a line
|
||||
try %/ exec -draft <a-h> <a-k> ^\h+[]}]$ <ret> m s \`|.\' <ret> 1<a-&> /
|
||||
_
|
||||
"
|
||||
try %< exec -draft <a-h> <a-k> ^\h+[]}]$ <ret> m s \`|.\' <ret> 1<a-&> >
|
||||
>
|
||||
>
|
||||
|
||||
def -hidden _ruby_indent_on_new_line "
|
||||
eval -draft -itersel '
|
||||
def -hidden _ruby_indent_on_new_line %(
|
||||
eval -draft -itersel %(
|
||||
# preserve previous line indent
|
||||
try %{ exec -draft <space> K <a-&> }
|
||||
# filter previous line
|
||||
@ -82,11 +82,11 @@ def -hidden _ruby_indent_on_new_line "
|
||||
# copy _#_ comment prefix and following white spaces
|
||||
try %{ exec -draft k x s ^\h*\K#\h* <ret> y j p }
|
||||
# indent after (else|elsif|rescue|when) keywords and lines beginning / ending with opener token
|
||||
try %_ exec -draft <space> k x <a-k> (else|elsif|rescue|when)|^\h*[[{]|[[{]$ <ret> j <a-gt> _
|
||||
try %( exec -draft <space> k x <a-k> (else|elsif|rescue|when)|^\h*[[{]|[[{]$ <ret> j <a-gt> )
|
||||
# indent after (begin|case|class|def|do|if|loop|module|unless|until|while) keywords and add _end_ keyword
|
||||
try %{ exec -draft <space> k x <a-k> (begin|case|class|def|do|(?<!els)if|loop|module|unless|until|while) <ret> x y p j a end <esc> k <a-gt> }
|
||||
'
|
||||
"
|
||||
)
|
||||
)
|
||||
|
||||
# Initialization
|
||||
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾
|
||||
|
Loading…
Reference in New Issue
Block a user