mirror of
https://github.com/mawww/kakoune.git
synced 2024-12-24 03:56:32 +03:00
parent
8c55acb076
commit
5989903e7c
@ -75,8 +75,8 @@ hook -group fish-highlight global WinSetOption filetype=fish %{ add-highlighter
|
||||
|
||||
hook global WinSetOption filetype=fish %{
|
||||
hook window InsertChar .* -group fish-indent _fish_indent_on_char
|
||||
hook window InsertChar \n -group fish-indent _fish_indent_on_new_line
|
||||
hook window InsertChar \n -group fish-insert _fish_insert_on_new_line
|
||||
hook window InsertChar \n -group fish-indent _fish_indent_on_new_line
|
||||
}
|
||||
|
||||
hook -group fish-highlight global WinSetOption filetype=(?!fish).* %{ remove-highlighter fish }
|
||||
|
@ -38,14 +38,14 @@ def -hidden _haskell_filter_around_selections %{
|
||||
|
||||
def -hidden _haskell_indent_on_new_line %{
|
||||
eval -draft -itersel %{
|
||||
# copy -- comments prefix and following white spaces
|
||||
try %{ exec -draft k x s ^\h*\K--\h* <ret> y gh j P }
|
||||
# preserve previous line indent
|
||||
try %{ exec -draft <space> K <a-&> }
|
||||
# align to first clause
|
||||
try %{ exec -draft <space> k x X s ^\h*(if|then|else)?\h*(([\w']+\h+)+=)?\h*(case\h+[\w']+\h+of|do|let|where)\h+\K.* <ret> s \`|.\' <ret> & }
|
||||
# filter previous line
|
||||
try %{ exec -draft k : _haskell_filter_around_selections <ret> }
|
||||
# copy -- comments prefix and following white spaces
|
||||
try %{ exec -draft k x s ^\h*\K--\h* <ret> y gh j P }
|
||||
# indent after lines beginning with condition or ending with expression or =(
|
||||
try %{ exec -draft <space> k x <a-k> ^\h*(if)|(case\h+[\w']+\h+of|do|let|where|[=(])$ <ret> j <a-gt> }
|
||||
}
|
||||
|
@ -51,12 +51,12 @@ def -hidden _javascript_indent_on_char %<
|
||||
|
||||
def -hidden _javascript_indent_on_new_line %<
|
||||
eval -draft -itersel %<
|
||||
# copy // comments prefix and following white spaces
|
||||
try %{ exec -draft k x s ^\h*\K#\h* <ret> y gh j P }
|
||||
# preserve previous line indent
|
||||
try %{ exec -draft <space> K <a-&> }
|
||||
# filter previous line
|
||||
try %{ exec -draft k : _javascript_filter_around_selections <ret> }
|
||||
# copy // comments prefix and following white spaces
|
||||
try %{ exec -draft k x s ^\h*\K#\h* <ret> y gh j P }
|
||||
# indent after lines beginning / ending with opener token
|
||||
try %_ exec -draft k x <a-k> ^\h*[[{]|[[{]$ <ret> j <a-gt> _
|
||||
>
|
||||
|
@ -96,8 +96,8 @@ hook -group lua-highlight global WinSetOption filetype=lua %{ add-highlighter re
|
||||
|
||||
hook global WinSetOption filetype=lua %{
|
||||
hook window InsertChar .* -group lua-indent _lua_indent_on_char
|
||||
hook window InsertChar \n -group lua-indent _lua_indent_on_new_line
|
||||
hook window InsertChar \n -group lua-insert _lua_insert_on_new_line
|
||||
hook window InsertChar \n -group lua-indent _lua_indent_on_new_line
|
||||
|
||||
alias window alt lua-alternative-file
|
||||
}
|
||||
|
@ -126,12 +126,12 @@ add-highlighter -group /markdown/content regex \H\K\h\h$ 0:PrimarySelection
|
||||
|
||||
def -hidden _markdown_indent_on_new_line %{
|
||||
eval -draft -itersel %{
|
||||
# copy block quote(s), list item prefix and following white spaces
|
||||
try %{ exec -draft k x s ^\h*\K((>\h*)|[*+-])+\h* <ret> y gh j P }
|
||||
# preserve previous line indent
|
||||
try %{ exec -draft <space> K <a-&> }
|
||||
# remove trailing white spaces
|
||||
try %{ exec -draft -itersel %{ k<a-x> s \h+$ <ret> d } }
|
||||
# copy block quote(s), list item prefix and following white spaces
|
||||
try %{ exec -draft k x s ^\h*\K((>\h*)|[*+-])+\h* <ret> y gh j P }
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -148,8 +148,8 @@ hook -group ruby-highlight global WinSetOption filetype=ruby %{ add-highlighter
|
||||
|
||||
hook global WinSetOption filetype=ruby %{
|
||||
hook window InsertChar .* -group ruby-indent _ruby_indent_on_char
|
||||
hook window InsertChar \n -group ruby-indent _ruby_indent_on_new_line
|
||||
hook window InsertChar \n -group ruby-insert _ruby_insert_on_new_line
|
||||
hook window InsertChar \n -group ruby-indent _ruby_indent_on_new_line
|
||||
|
||||
alias window alt ruby-alternative-file
|
||||
}
|
||||
|
@ -41,12 +41,12 @@ def -hidden _rust_filter_around_selections %{
|
||||
|
||||
def -hidden _rust_indent_on_new_line %~
|
||||
eval -draft -itersel %<
|
||||
# copy // comments prefix and following white spaces
|
||||
try %{ exec -draft k x s ^\h*\K//\h* <ret> y gh j P }
|
||||
# preserve previous line indent
|
||||
try %{ exec -draft <space> K <a-&> }
|
||||
# filter previous line
|
||||
try %{ exec -draft k : _rust_filter_around_selections <ret> }
|
||||
# copy // comments prefix and following white spaces
|
||||
try %{ exec -draft k x s ^\h*\K//\h* <ret> y gh j P }
|
||||
# indent after lines ending with { or (
|
||||
try %[ exec -draft k <a-x> <a-k> [{(]\h*$ <ret> j <a-gt> ]
|
||||
# align to opening paren of previous line
|
||||
|
@ -41,12 +41,12 @@ def -hidden _scala_filter_around_selections %{
|
||||
|
||||
def -hidden _scala_indent_on_new_line %[
|
||||
eval -draft -itersel %[
|
||||
# copy // comments prefix and following white spaces
|
||||
try %[ exec -draft k x s ^\h*\K#\h* <ret> y gh j P ]
|
||||
# preserve previous line indent
|
||||
try %[ exec -draft <space> K <a-&> ]
|
||||
# filter previous line
|
||||
try %[ exec -draft k : _scala_filter_around_selections <ret> ]
|
||||
# copy // comments prefix and following white spaces
|
||||
try %[ exec -draft k x s ^\h*\K#\h* <ret> y gh j P ]
|
||||
# indent after lines ending with {
|
||||
try %[ exec -draft k x <a-k> \{$ <ret> j <a-gt> ]
|
||||
]
|
||||
|
@ -34,12 +34,12 @@ def -hidden _yaml_filter_around_selections %{
|
||||
|
||||
def -hidden _yaml_indent_on_new_line %{
|
||||
eval -draft -itersel %{
|
||||
# copy '#' comment prefix and following white spaces
|
||||
try %{ exec -draft k x s ^\h*\K#\h* <ret> y gh j P }
|
||||
# preserve previous line indent
|
||||
try %{ exec -draft <space> K <a-&> }
|
||||
# filter previous line
|
||||
try %{ exec -draft k : _yaml_filter_around_selections <ret> }
|
||||
# copy '#' comment prefix and following white spaces
|
||||
try %{ exec -draft k x s ^\h*\K#\h* <ret> y gh j P }
|
||||
# indent after :
|
||||
try %{ exec -draft <space> k x <a-k> :$ <ret> j <a-gt> }
|
||||
}
|
||||
|
@ -238,11 +238,11 @@ hook global WinSetOption filetype=(c|cpp|objc) %[
|
||||
}
|
||||
|
||||
hook -group c-family-indent window InsertEnd .* c-family-trim-autoindent
|
||||
hook -group c-family-insert window InsertChar \n c-family-insert-on-newline
|
||||
hook -group c-family-indent window InsertChar \n c-family-indent-on-newline
|
||||
hook -group c-family-indent window InsertChar \{ c-family-indent-on-opening-curly-brace
|
||||
hook -group c-family-indent window InsertChar \} c-family-indent-on-closing-curly-brace
|
||||
hook -group c-family-insert window InsertChar \} c-family-insert-on-closing-curly-brace
|
||||
hook -group c-family-insert window InsertChar \n c-family-insert-on-newline
|
||||
|
||||
alias window alt c-family-alternative-file
|
||||
]
|
||||
|
@ -52,12 +52,12 @@ add-highlighter -group /kakrc/shell ref sh
|
||||
|
||||
def -hidden kak-indent-on-new-line %{
|
||||
eval -draft -itersel %{
|
||||
# copy '#' comment prefix and following white spaces
|
||||
try %{ exec -draft k x s ^\h*#\h* <ret> y jgh P }
|
||||
# preserve previous line indent
|
||||
try %{ exec -draft <space> K <a-&> }
|
||||
# cleanup trailing whitespaces from previous line
|
||||
try %{ exec -draft k <a-x> s \h+$ <ret> d }
|
||||
# copy '#' comment prefix and following white spaces
|
||||
try %{ exec -draft k x s ^\h*#\h* <ret> y jgh P }
|
||||
# indent after line ending with %[[:punct:]]
|
||||
try %{ exec -draft k <a-x> <a-k> \%[[:punct:]]$ <ret> j <a-gt> }
|
||||
}
|
||||
|
@ -65,12 +65,12 @@ add-highlighter -group /python/comment fill comment
|
||||
|
||||
def -hidden python-indent-on-new-line %{
|
||||
eval -draft -itersel %{
|
||||
# copy '#' comment prefix and following white spaces
|
||||
try %{ exec -draft k x s ^\h*#\h* <ret> y jgh P }
|
||||
# preserve previous line indent
|
||||
try %{ exec -draft <space> K <a-&> }
|
||||
# cleanup trailing whitespaces from previous line
|
||||
try %{ exec -draft k <a-x> s \h+$ <ret> d }
|
||||
# copy '#' comment prefix and following white spaces
|
||||
try %{ exec -draft k x s ^\h*#\h* <ret> y jgh P }
|
||||
# indent after line ending with :
|
||||
try %{ exec -draft <space> k x <a-k> :$ <ret> j <a-gt> }
|
||||
}
|
||||
|
@ -31,12 +31,12 @@ def -hidden _cabal_filter_around_selections %{
|
||||
|
||||
def -hidden _cabal_indent_on_new_line %[
|
||||
eval -draft -itersel %[
|
||||
# copy '#' comment prefix and following white spaces
|
||||
try %[ exec -draft k x s ^\h*\K#\h* <ret> y gh j P ]
|
||||
# preserve previous line indent
|
||||
try %[ exec -draft <space> K <a-&> ]
|
||||
# filter previous line
|
||||
try %[ exec -draft k : _cabal_filter_around_selections <ret> ]
|
||||
# copy '#' comment prefix and following white spaces
|
||||
try %[ exec -draft k x s ^\h*\K#\h* <ret> y gh j P ]
|
||||
# indent after lines ending with { or :
|
||||
try %[ exec -draft <space> k x <a-k> [:{]$ <ret> j <a-gt> ]
|
||||
]
|
||||
|
@ -55,12 +55,12 @@ def -hidden _coffee_filter_around_selections %{
|
||||
|
||||
def -hidden _coffee_indent_on_new_line %{
|
||||
eval -draft -itersel %{
|
||||
# copy '#' comment prefix and following white spaces
|
||||
try %{ exec -draft k x s ^ \h * \K \# \h * <ret> y gh j P }
|
||||
# preserve previous line indent
|
||||
try %{ exec -draft K <a-&> }
|
||||
# filter previous line
|
||||
try %{ exec -draft k : _coffee_filter_around_selections <ret> }
|
||||
# copy '#' comment prefix and following white spaces
|
||||
try %{ exec -draft k x s ^ \h * \K \# \h * <ret> y gh j P }
|
||||
# indent after start structure
|
||||
try %{ exec -draft k x <a-k> ^ \h * (case|catch|class|else|finally|for|function|if|switch|try|while|with) \b | (=|->) $ <ret> j <a-gt> }
|
||||
}
|
||||
|
@ -63,12 +63,12 @@ def -hidden _cucumber_filter_around_selections %{
|
||||
|
||||
def -hidden _cucumber_indent_on_new_line %{
|
||||
eval -draft -itersel %{
|
||||
# copy '#' comment prefix and following white spaces
|
||||
try %{ exec -draft k x s ^\h*\K#\h* <ret> y gh j P }
|
||||
# preserve previous line indent
|
||||
try %{ exec -draft <space> K <a-&> }
|
||||
# filter previous line
|
||||
try %{ exec -draft k : _cucumber_filter_around_selections <ret> }
|
||||
# copy '#' comment prefix and following white spaces
|
||||
try %{ exec -draft k x s ^\h*\K#\h* <ret> y gh j P }
|
||||
# indent after lines containing :
|
||||
try %{ exec -draft <space> k x <a-k> : <ret> j <a-gt> }
|
||||
}
|
||||
|
@ -40,12 +40,12 @@ def -hidden _haml_filter_around_selections %{
|
||||
|
||||
def -hidden _haml_indent_on_new_line %{
|
||||
eval -draft -itersel %{
|
||||
# copy '/' comment prefix and following white spaces
|
||||
try %{ exec -draft k x s ^\h*\K/\h* <ret> y gh j P }
|
||||
# preserve previous line indent
|
||||
try %{ exec -draft <space> K <a-&> }
|
||||
# filter previous line
|
||||
try %{ exec -draft k : _haml_filter_around_selections <ret> }
|
||||
# copy '/' comment prefix and following white spaces
|
||||
try %{ exec -draft k x s ^\h*\K/\h* <ret> y gh j P }
|
||||
# indent after lines beginning with : or -
|
||||
try %{ exec -draft k x <a-k> ^\h*[:-] <ret> j <a-gt> }
|
||||
}
|
||||
|
@ -41,12 +41,12 @@ def -hidden _hbs_filter_around_selections %{
|
||||
|
||||
def -hidden _hbs_indent_on_new_line %{
|
||||
eval -draft -itersel %{
|
||||
# copy '/' comment prefix and following white spaces
|
||||
try %{ exec -draft k x s ^\h*\K/\h* <ret> y j p }
|
||||
# preserve previous line indent
|
||||
try %{ exec -draft <space> K <a-&> }
|
||||
# filter previous line
|
||||
try %{ exec -draft k : _hbs_filter_around_selections <ret> }
|
||||
# copy '/' comment prefix and following white spaces
|
||||
try %{ exec -draft k x s ^\h*\K/\h* <ret> y j p }
|
||||
# indent after lines beginning with : or -
|
||||
try %{ exec -draft k x <a-k> ^\h*[:-] <ret> j <a-gt> }
|
||||
}
|
||||
|
@ -76,12 +76,12 @@ def -hidden _moon_indent_on_char %{
|
||||
|
||||
def -hidden _moon_indent_on_new_line %{
|
||||
eval -draft -itersel %{
|
||||
# copy -- comment prefix and following white spaces
|
||||
try %{ exec -draft k x s ^ \h * \K -- \h * <ret> y gh j P }
|
||||
# preserve previous line indent
|
||||
try %{ exec -draft K <a-&> }
|
||||
# filter previous line
|
||||
try %{ exec -draft k : _moon_filter_around_selections <ret> }
|
||||
# copy -- comment prefix and following white spaces
|
||||
try %{ exec -draft k x s ^ \h * \K -- \h * <ret> y gh j P }
|
||||
# indent after start structure
|
||||
try %{ exec -draft k x <a-k> ^ \h * (class|else(if)?|for|if|switch|unless|when|while|with) \b | ([:=]|[-=]>) $ <ret> j <a-gt> }
|
||||
# deindent after return statements
|
||||
|
@ -45,12 +45,12 @@ def -hidden _php_indent_on_char %<
|
||||
|
||||
def -hidden _php_indent_on_new_line %<
|
||||
eval -draft -itersel %<
|
||||
# copy // comments prefix and following white spaces
|
||||
try %{ exec -draft k x s ^\h*\K#\h* <ret> y gh j P }
|
||||
# preserve previous line indent
|
||||
try %{ exec -draft <space> K <a-&> }
|
||||
# filter previous line
|
||||
try %{ exec -draft k : _php_filter_around_selections <ret> }
|
||||
# copy // comments prefix and following white spaces
|
||||
try %{ exec -draft k x s ^\h*\K#\h* <ret> y gh j P }
|
||||
# indent after lines beginning / ending with opener token
|
||||
try %_ exec -draft k x <a-k> ^\h*[[{]|[[{]$ <ret> j <a-gt> _
|
||||
>
|
||||
|
@ -44,12 +44,12 @@ def -hidden _ragel_indent_on_char %<
|
||||
|
||||
def -hidden _ragel_indent_on_new_line %<
|
||||
eval -draft -itersel %<
|
||||
# copy _#_ comment prefix and following white spaces
|
||||
try %{ exec -draft k x s ^\h*\K#\h* <ret> y gh j P }
|
||||
# preserve previous line indent
|
||||
try %{ exec -draft <space> K <a-&> }
|
||||
# filter previous line
|
||||
try %{ exec -draft k : _ragel_filter_around_selections <ret> }
|
||||
# copy _#_ comment prefix and following white spaces
|
||||
try %{ exec -draft k x s ^\h*\K#\h* <ret> y gh j P }
|
||||
# indent after lines ending with opener token
|
||||
try %< exec -draft k x <a-k> [[{(*]$ <ret> j <a-gt> >
|
||||
>
|
||||
|
@ -36,12 +36,12 @@ def -hidden _sass_filter_around_selections %{
|
||||
|
||||
def -hidden _sass_indent_on_new_line %{
|
||||
eval -draft -itersel %{
|
||||
# copy '/' comment prefix and following white spaces
|
||||
try %{ exec -draft k x s ^\h*\K/\h* <ret> y gh j P }
|
||||
# preserve previous line indent
|
||||
try %{ exec -draft <space> K <a-&> }
|
||||
# filter previous line
|
||||
try %{ exec -draft k : _sass_filter_around_selections <ret> }
|
||||
# copy '/' comment prefix and following white spaces
|
||||
try %{ exec -draft k x s ^\h*\K/\h* <ret> y gh j P }
|
||||
# avoid indent after properties and comments
|
||||
try %{ exec -draft k x <a-K> [:/] <ret> j <a-gt> }
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user