Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Add option to choose indention style #306

Open
diktomat opened this issue Feb 26, 2023 · 2 comments
Open

Add option to choose indention style #306

diktomat opened this issue Feb 26, 2023 · 2 comments
Labels
enhancement New feature or request needs triage

Comments

@diktomat
Copy link

Indention style was already discussed in #131 with the conclusion of following the nixpkgs style of using two spaces, which obviously is the right choice for a project aiming to become the default. For personal preference and accessibility (as discussed there already) however, it would be great to be able to choose to use tabs (or more than two spaces) for personal files.

@diktomat diktomat added enhancement New feature or request needs triage labels Feb 26, 2023
@toastal
Copy link

toastal commented Mar 9, 2023

This resonates with me. I deeply-nested nix files at work and Flakes in general tend to be quite nest-y. I find these files grueling to read because 2 spaces doesn't give me enough visual contrast (same issue I've been having with a lot of languages recently). I tried to make an overlay that could wrap nixpkgs-fmt and pipe it to GNU unexpand as a workaround but upon multiple saves, the indentation of multiline strings kept increasing because how tabs are currently handled. (I tried prepending expend but then my script lost the flags; I could do some parse of the flags but now it's no longer a two-line wrapper)

@zimbatm
Copy link
Member

zimbatm commented Mar 9, 2023

I'm open to getting a PR for that.

Just know that tabs are not handled well in regard to multi-line strings; Nix includes them as part of the content of the string.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request needs triage
Projects
None yet
Development

No branches or pull requests

3 participants