Skip to content

Formatter #23

Open
Open

Description

@JojOatXGME

It would be nice to have a basic formatter which manages indentation.

EDIT: Some reference: https://nixos.org/manual/nixpkgs/stable/#sec-syntax

Activity

  1. changed the title [-]Basic Formatter[/-] [+]Formatter[/+] on Dec 27, 2020
  2. r-k-b commented on Dec 29, 2020

    @r-k-b

    In the meantime, hooking up nixfmt with a File Watcher works reasonably well:
    image

  3. JojOatXGME commented on Jun 8, 2024

    @JojOatXGME
    ContributorAuthor

    Coming soon with the next release, there will be a new option in the settings which can be used to integrate nixpkgs-fmt and potentially other formatters. Thanks goes to @cottand.

    Screenshot of the settings menu for external formatter

    I think it would still be nice to have a very basic built-in formatter, which can at least handle the indentation in lists, attribute sets and let expressions. I will therefore keep this ticket open.

  4. TheArcaneBrony commented on Aug 1, 2024

    @TheArcaneBrony
    Member

    Can confirm this feature works, personally using nixfmt-rfc-style with the following command: nix --extra-experimental-features "nix-command flakes" run nixpkgs#nixfmt-rfc-style -- -w 240

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions