Skip to content
zed-extensionsPublic

About

Nix language support in Zed

Resources

Stars

128 stars

Watchers

3 watching

Forks

Latest commit

 

History

45 Commits

Folders and files

Repository files navigation

Nix

Nix language support in Zed

Configuration

Various options can be configured via Zed settings.json files.

Configure Nixd

{
  "lsp": {
    "nixd": {
      "settings": {
        "diagnostic": {
          "suppress": [ "sema-extra-with" ]
        }
      }
    }
  }
}

See: Nixd LSP Configuration Docs for more options.

Configure Nil

{
  "lsp": {
    "nil": {
      "settings": {
         "diagnostics": {
          "ignored": [ "unused_binding" ]
        }
      }
    }
  }
}

See: Nil LSP Configuration Docs for more options.

Only use Nixd

{
  "languages": {
    "Nix": {
      "language_servers": [ "nixd", "!nil" ]
    }
  }
}

Only use Nil

{
  "languages": {
    "Nix": {
      "language_servers": [ "nil", "!nixd" ]
    }
  }
}

Configure formatters

You can configure formatters through LSP:

{
  "lsp": {
    "nil": {    // or "nixd":
      "initialization_options": {
        "formatting": {
          "command": ["alejandra", "--quiet", "--"]  // or ["nixfmt"]
        }
      }
    }
  }
}

Or through Zed itself:

{
  "languages": {
    "Nix": {
      "formatter": {
        "external": {
          "command": "alejandra",  // or "nixfmt"
          "arguments": ["--quiet", "--"]
        }
      }
    }
  }
}

About

Nix language support in Zed

Resources

Stars

128 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages