Replies: 16 comments 7 replies
|
I would like to second this. I'm currently doing the exact same thing, and am still worried I run the risk of starting to use a new language that automatically starts using spaces for indentation without me noticing. Not trying to get into the tabs vs spaces debate (just adding my objective reasoning for this need), but my personal opinion is that someone's personal indentation width preference should not be forced on everyone else. I have a lot of trouble reading 2-space indentation, so I like to render at 4, and tabs let me do that, so as a courtesy to others, I use tabs so they can view my code however they like. However, in today's development world, devs (or at least I) use so many languages on a day-to-day basis it's hard to keep track, and I'd love a global setting with language-specific override for languages with intolerant syntax (for example, Home Assistant's YAML parser really seems to hate tabs, so I should be able to override for YAML). I may be willing to help with this in my spare time if someone could point me to the relevant parts of the project. |
|
I think this is a key feature for users working on projects which have a strict coding style and use multiple programming languages. Also note that simply enumerating indent overrides for all languages which helix currently knows about is not a one-off solution. This list would also have to be updated if new languages are added to Helix's default |
|
I'm actually personally against having a global setting for tab width. Each language has its own style, and I don't agree with the mindset of just ignoring idiomatic conventions. Just as one shouldn't write snake case in Java, or camel case in Rust, one shouldn't use an unconventional tab width. Also, it's likely that if you really insisted on doing this, you're probably not talking about more than half a dozen languages, max. It's not like you'd notice some Prolog dialect was added and have to go add another entry. |
|
I don't actually use Helix anymore (and will probably unsubscribe from this ticket), but as of when I stopped, I had 11: C++, C, Rust, JavaScript, TypeScript, HTML, YAML, Python, CSS, Markdown, and Bash. For the sort of personal use I was using it for, consistency with my own opinions was far more important than consistency with the opinions of some style guide. The nice thing about optional settings is that you don't have to set them if they don't suit you :) |
|
I understand that I'm not the target audience as I'm pretty much a normie who enjoys tinkering with my computer, a non-dev, mostly janky scripts, configs and markdown documents. But I would also like some way of telling Helix: unless told otherwise a tab consists of spaces, two spaces to be exact. |
My issue is that I don't want to write a config for every language. |
|
in regards to #6652 If going with that, then to increase reuse whilst resolving the issue posed in the openning comment of this thread, perhaps languages which are dependent on a specific indentation can have their inheritance set to the helix default, by default as opposed to the user specified global setting. I do not have the time to change this my self and it is not an issue that would be desirable for me to see develop into a halt in existing work. |
|
i think global options should override the default languages.toml and the global languages.toml, meaning they are only overriddeo by the languages.toml present in a project directory This means that you can have
Which I think is an ideal amount of control |
That's why formatters and linters are a thing 🙃. And that's why the global setting should be just a default, overriden by whatever
|
|
Alternatively, to the original proposal, I'd suggest creating a configuration to set a default indent and unit only for newly created buffers, i.e. just after I hit |
|
what about [[language]]
name = "*"at the top of your languages config will allow setting defaults to all languages options, and will be overridden by more specific names below it? |
|
Something that would also be a good idea is to have some sort of default precedence since stuff like Makefiles require tabs and not spaces. |
|
Being able to set the tab-width globally is also an accessibility concern. Some people need a different tab width for better readability. This wouldn't change the code as it's just a visual setting. Having to change it for every language is very tedious. Please reconsider. |
|
And also the amount of spaces inserted. That is what I was getting at, but visual tab width too.
Sent from [Proton Mail](https://proton.me/mail/home) for Android.
…-------- Original Message --------
On Monday, 03/16/26 at 06:59 literallylara ***@***.***> wrote:
Being able to set the tab-width globally is also an accessibility concern. Some people need a different tab width for better readability. This wouldn't change the code as it's just a visual setting. Having to change it for every language is very tedious.
Please reconsider.
—
Reply to this email directly, [view it on GitHub](#10363 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/ATEA3DEDBUX25PWW2XVTO3L4Q7UDHAVCNFSM6AAAAACMIMJ6GKVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTMMJVHAZDQNY).
You are receiving this because you commented.Message ID: ***@***.***>
|
|
Hi. I am new to Helix. I am deciding to migrate over from neovim, in search of creating a performative IDE for my new programming language. I might be under some misconceptions here, but from what I understand from reading this, talking with AI, and going through the documentation, that the developers prefer to let the language backends dictate the indentation settings for tab width and tabs vs spaces, requiring the end user to override in every particular situation. Re: No global setting for preferring Tabs or Spaces
Ergo:
However:
Re: No global setting for preferring Tab Width
Suggestions:
|
|
This is one of my biggest frustrations with Helix, which I have more or less completely switched to otherwise. It strikes me that an issue is that not all files conform to existing programming languages; some are simply free-form text. For example, I was editing Some files containing configuration data aren't worth adding a dedicated language for; consider Perhaps some sort of inheritance syntax could be leveraged to ameliorate some of the tedium of repeated language definitions, though I could imagine some thorny issues when it comes to overriding settings that a different language inherits from; to my knowledge there is nothing like that presently, though |

Uh oh!
There was an error while loading. Please reload this page.
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:I discovered while writing this that I don't actually have to set
auto-pairs = falsein 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
indentconfiguration, to avoid emitting broken makefiles when the user has set space-indentation globally. Alternatively, the language-levelindentcould be split intoindentanddefault-indent, where the order of precedence islanguage.indent > global.indent > language.default-indent.All reactions