1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-12-21 18:41:29 +03:00

Use indentwidth for lisp, scheme, and Clojure

This commit is contained in:
Jason Felice 2019-02-04 12:23:57 -05:00
parent 5c0175d90a
commit 58ab144865
2 changed files with 11 additions and 6 deletions

View File

@ -179,8 +179,9 @@ define-command -hidden clojure-indent-on-new-line %{
execute-keys -draft '[bl"i<a-Z><gt>"wZ' execute-keys -draft '[bl"i<a-Z><gt>"wZ'
try %{ try %{
# If a special form, indent another space # If a special form, indent another (indentwidth - 1) spaces
execute-keys -draft '"wze<a-k>\A' %opt{clojure_special_indent_forms} '\z<ret><a-L>s.\K.*<ret><a-;>;"i<a-Z><gt>' execute-keys -draft '"wze<a-k>\A' %opt{clojure_special_indent_forms} '\z<ret>'
execute-keys -draft '"wze<a-L>s.{' %sh{printf $(( kak_opt_indentwidth - 1 ))} '}\K.*<ret><a-;>;"i<a-Z><gt>'
} catch %{ } catch %{
# If not special and parameter appears on line 1, indent to parameter # If not special and parameter appears on line 1, indent to parameter
execute-keys -draft '"wze<a-l>s\h\K[^\s].*<ret><a-;>;"i<a-Z><gt>' execute-keys -draft '"wze<a-l>s\h\K[^\s].*<ret><a-;>;"i<a-Z><gt>'

View File

@ -43,10 +43,14 @@ define-command -hidden lisp-indent-on-new-line %{
try %{ try %{
execute-keys -draft '[bl"i<a-Z><gt>"wZ' execute-keys -draft '[bl"i<a-Z><gt>"wZ'
try %{ execute-keys -draft '"wz<a-l>s.\K.*<ret><a-;>;"i<a-Z><gt>' } try %{
# If a special form, indent another (indentwidth - 1) spaces
execute-keys -draft '"wze<a-k>\A' %opt{lisp_special_indent_forms} '\z<ret>'
execute-keys -draft '"wze<a-L>s.{' %sh{printf $(( kak_opt_indentwidth - 1 ))} '}\K.*<ret><a-;>;"i<a-Z><gt>'
} catch %{
# If not "special" form and parameter appears on line 1, indent to parameter # If not "special" form and parameter appears on line 1, indent to parameter
execute-keys -draft '"wze<a-K>\A' %opt{lisp_special_indent_forms} '\z<ret>' '<a-l>s\h\K[^\s].*<ret><a-;>;"i<a-Z><gt>' execute-keys -draft '"wze<a-l>s\h\K[^\s].*<ret><a-;>;"i<a-Z><gt>'
}
} }
try %{ execute-keys -draft '[rl"i<a-Z><gt>' } try %{ execute-keys -draft '[rl"i<a-Z><gt>' }
try %{ execute-keys -draft '[Bl"i<a-Z><gt>' } try %{ execute-keys -draft '[Bl"i<a-Z><gt>' }