diff --git a/rc/base/clojure.kak b/rc/base/clojure.kak index 451c13f59..da6134a65 100644 --- a/rc/base/clojure.kak +++ b/rc/base/clojure.kak @@ -179,8 +179,9 @@ define-command -hidden clojure-indent-on-new-line %{ execute-keys -draft '[bl"i"wZ' try %{ - # If a special form, indent another space - execute-keys -draft '"wze\A' %opt{clojure_special_indent_forms} '\zs.\K.*;"i' + # If a special form, indent another (indentwidth - 1) spaces + execute-keys -draft '"wze\A' %opt{clojure_special_indent_forms} '\z' + execute-keys -draft '"wzes.{' %sh{printf $(( kak_opt_indentwidth - 1 ))} '}\K.*;"i' } catch %{ # If not special and parameter appears on line 1, indent to parameter execute-keys -draft '"wzes\h\K[^\s].*;"i' diff --git a/rc/base/lisp.kak b/rc/base/lisp.kak index d0ab1d197..378bb3c52 100644 --- a/rc/base/lisp.kak +++ b/rc/base/lisp.kak @@ -43,10 +43,14 @@ define-command -hidden lisp-indent-on-new-line %{ try %{ execute-keys -draft '[bl"i"wZ' - try %{ execute-keys -draft '"wzs.\K.*;"i' } - - # If not "special" form and parameter appears on line 1, indent to parameter - execute-keys -draft '"wze\A' %opt{lisp_special_indent_forms} '\z' 's\h\K[^\s].*;"i' + try %{ + # If a special form, indent another (indentwidth - 1) spaces + execute-keys -draft '"wze\A' %opt{lisp_special_indent_forms} '\z' + execute-keys -draft '"wzes.{' %sh{printf $(( kak_opt_indentwidth - 1 ))} '}\K.*;"i' + } catch %{ + # If not "special" form and parameter appears on line 1, indent to parameter + execute-keys -draft '"wzes\h\K[^\s].*;"i' + } } try %{ execute-keys -draft '[rl"i' } try %{ execute-keys -draft '[Bl"i' }