With the default C indentation rules, an open brace on a line by itself is exdented when you type it in. I
want to disable this to support the GNU C indentation style, which looks like this:
if (condition)
{
statements;
}
I found I could disable this in rc/filetype/c-family.kak
by commenting out the line:
hook -group "%val{hook_param_capture_1}-indent" window InsertChar \{ c-family-indent-on-opening-curly-brace
I couldn’t work out how to disable this in my kakrc
. I tried redefining c-family-indent-on-opening-curly-brace
completely, with
define-command -hidden -override c-family-indent-on-opening-curly-brace %[
]
- however, this had the effect of disabling autoindent completely for C files. I found a message in *debug*
:
error running hook WinSetOption(filetype=c)/: 2:5: 'require-module': 55:1: 'define-command': command 'c-family-indent-on-opening-curly-brace' already defined
Although it’s not clear, apparently the "%val{hook_param_capture_1}-indent"
group is c-indent
, but I don’t want to disable c-indent
completely by adding it to disabled_hooks
. remove-hooks
also appears to operate on whole groups.
Is there any way of customizing this without editing the installed c-family.kak
?