How to disable smart indent?
I'd like auto-indentation to always use the indentation of the previous line.
I have this (| is the cursor)
yo {|
}
I press enter and I'd like to have this
yo {
|
}
In C-like languages this always increases the indentation but I'd like to deactivate that.
Is this possible? Thanks.
EDIT: dammit, I just remembered Discussions exist, sorry!
I don't think there's a config option available, but you should be able to delete the indents.toml for the associated language in your runtime/queries folder.
Edit: NVM, I misunderstood.
What I want is the equivalent of set autoindent and set indentexpr= in vim. If this is a feature that would be accepted, I could implement it after discussing how the feature would look like.
Seconding this feature. The Haskell indentation is a bit wonky, so I was looking for a way to make the indentation always use the level of the previous line.
Haskell doesn't yet have indent queries, so smart indent is automatically disabled there. Maybe your issue is that the "dumb" indent copies the indentation level and not the indent string. This means that if the indentation is rounded down to the nearest indent level, which could cause issues. Another problem might be the auto-detection of the indent style that Helix does. If for example a large fraction of the lines in your file are aligned to something, the heuristic might guess an incorrect indentation style.
I implemented an option for choosing the indentation heuristic in #8307. @emi2k01, your issue is caused by the auto-pairs code, so currently the only way to change that behavior would be to exclude curly braces from auto-pairing.