mirror of
https://github.com/mawww/kakoune.git
synced 2024-11-25 10:32:19 +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 }
|
try %{ exec -draft -itersel <a-x> s \h+$ <ret> d }
|
||||||
}
|
}
|
||||||
|
|
||||||
def -hidden _json_indent_on_char "
|
def -hidden _json_indent_on_char %<
|
||||||
eval -draft -itersel %_
|
eval -draft -itersel %<
|
||||||
# align closer token to its opener when alone on a line
|
# 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 "
|
def -hidden _json_indent_on_new_line %<
|
||||||
eval -draft -itersel '
|
eval -draft -itersel %<
|
||||||
# preserve previous line indent
|
# preserve previous line indent
|
||||||
try %{ exec -draft <space> K <a-&> }
|
try %{ exec -draft <space> K <a-&> }
|
||||||
# filter previous line
|
# filter previous line
|
||||||
try %{ exec -draft k : _json_filter_around_selections <ret> }
|
try %{ exec -draft k : _json_filter_around_selections <ret> }
|
||||||
# indent after lines beginning with opener token
|
# 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
|
# 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 }
|
try %{ exec -draft -itersel <a-x> s \h+$ <ret> d }
|
||||||
}
|
}
|
||||||
|
|
||||||
def -hidden _ragel_indent_on_char "
|
def -hidden _ragel_indent_on_char %<
|
||||||
eval -draft -itersel %_
|
eval -draft -itersel %<
|
||||||
# align closer token to its opener when alone on a line
|
# 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-&> >
|
||||||
try %/ exec -draft <a-h> <a-k> ^\h+ [*]$ <ret> <a-?> [*]$ <ret> 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 "
|
def -hidden _ragel_indent_on_new_line %<
|
||||||
eval -draft -itersel '
|
eval -draft -itersel %<
|
||||||
# preserve previous line indent
|
# preserve previous line indent
|
||||||
try %{ exec -draft <space> K <a-&> }
|
try %{ exec -draft <space> K <a-&> }
|
||||||
# filter previous line
|
# filter previous line
|
||||||
@ -55,9 +55,9 @@ def -hidden _ragel_indent_on_new_line "
|
|||||||
# copy _#_ comment prefix and following white spaces
|
# copy _#_ comment prefix and following white spaces
|
||||||
try %{ exec -draft k x s ^\h*\K#\h* <ret> y j p }
|
try %{ exec -draft k x s ^\h*\K#\h* <ret> y j p }
|
||||||
# indent after lines ending with opener token
|
# 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
|
# 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 }
|
try %{ exec -draft -itersel <a-x> s \h+$ <ret> d }
|
||||||
}
|
}
|
||||||
|
|
||||||
def -hidden _ruby_indent_on_char "
|
def -hidden _ruby_indent_on_char %<
|
||||||
eval -draft -itersel %_
|
eval -draft -itersel %<
|
||||||
# deindent on (else|elsif|end|rescue|when) keyword insertion
|
# 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> }
|
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
|
# 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 "
|
def -hidden _ruby_indent_on_new_line %(
|
||||||
eval -draft -itersel '
|
eval -draft -itersel %(
|
||||||
# preserve previous line indent
|
# preserve previous line indent
|
||||||
try %{ exec -draft <space> K <a-&> }
|
try %{ exec -draft <space> K <a-&> }
|
||||||
# filter previous line
|
# filter previous line
|
||||||
@ -82,11 +82,11 @@ def -hidden _ruby_indent_on_new_line "
|
|||||||
# copy _#_ comment prefix and following white spaces
|
# copy _#_ comment prefix and following white spaces
|
||||||
try %{ exec -draft k x s ^\h*\K#\h* <ret> y j p }
|
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
|
# 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
|
# 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> }
|
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
|
# Initialization
|
||||||
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾
|
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾
|
||||||
|
Loading…
Reference in New Issue
Block a user