Skip to content

Allow setting indent globally #3159

@scgtrp

Description

@scgtrp

I currently have an incredibly long ~/.config/helix/languages.toml, to which I append a copy of this for every language I use or encounter:

[[language]]
name = "..."
indent = { tab-width = 4, unit = "\t" }
auto-pairs = false

I discovered while writing this that I don't actually have to set auto-pairs = false in each language anymore (I don't think the global one existed/worked when I started using Helix?), so that's neat, thanks!

I would like to be able to do the same for indent. The desired behavior is that I can say "always indent with tabs, for any file type", and spaces are only used if I open an existing file that is already indented with spaces.

Potential issue with this: Some languages (e.g. makefiles) require a particular type of indentation as part of their syntax. These languages should probably have some sort of "no, really, use this even if the user said something else" flag in their indent configuration, to avoid emitting broken makefiles when the user has set space-indentation globally. Alternatively, the language-level indent could be split into indent and default-indent, where the order of precedence is language.indent > global.indent > language.default-indent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-helix-termArea: Helix term improvementsC-enhancementCategory: Improvements

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions