diff --git a/rc/filetype/crystal.kak b/rc/filetype/crystal.kak index 5cece7c3..8ce70714 100644 --- a/rc/filetype/crystal.kak +++ b/rc/filetype/crystal.kak @@ -201,12 +201,16 @@ define-command -hidden crystal-insert-on-new-line %{ } define-command -hidden crystal-indent-on-char %{ + evaluate-commands -no-hooks -draft -itersel %{ + # align 'else/elsif' to 'if' + try %{ execute-keys -draft ^\h*(?:else|elsif)$ ^\h*(?:if) 1 } + } } define-command -hidden crystal-fetch-keywords %{ set-register dquote %sh{ curl --location https://github.com/crystal-lang/crystal/raw/master/src/compiler/crystal/syntax/lexer.cr | - kak -f '%1scheck_ident_or_keyword\(:(\w+\??), \w+\)y%aa|sort' + kak -f '%1scheck_ident_or_keyword\(:(\w+\??), \w+\)y%aa|sort' } }