### Configure formatters via LSP Source: https://github.com/zed-extensions/nix/blob/main/README.md Configure formatters through LSP by setting the formatting command in the initialization options for nil (or nixd). Use 'alejandra --quiet --' or 'nixfmt'. ```jsonc { "lsp": { "nil": { // or "nixd": "initialization_options": { "formatting": { "command": ["alejandra", "--quiet", "--"] // or ["nixfmt"] } } } } } ``` -------------------------------- ### Configure Nil LSP settings Source: https://github.com/zed-extensions/nix/blob/main/README.md Configure the nil language server in Zed's settings.json to ignore the 'unused_binding' diagnostic. See the Nil LSP Configuration Docs for more options. ```json { "lsp": { "nil": { "settings": { "diagnostics": { "ignored": [ "unused_binding" ] } } } } } ``` -------------------------------- ### Configure formatters via Zed Source: https://github.com/zed-extensions/nix/blob/main/README.md Configure formatters through Zed itself by setting the external formatter command and arguments for Nix files. Use 'alejandra' or 'nixfmt'. ```jsonc { "languages": { "Nix": { "formatter": { "external": { "command": "alejandra", // or "nixfmt" "arguments": ["--quiet", "--"] } } } } } ``` -------------------------------- ### Only use Nil language server Source: https://github.com/zed-extensions/nix/blob/main/README.md Configure Zed to use only the nil language server for Nix files, disabling nixd. ```json { "languages": { "Nix": { "language_servers": [ "nil", "!nixd" ] } } } ``` -------------------------------- ### Only use Nixd language server Source: https://github.com/zed-extensions/nix/blob/main/README.md Configure Zed to use only the nixd language server for Nix files, disabling nil. ```json { "languages": { "Nix": { "language_servers": [ "nixd", "!nil" ] } } } ``` -------------------------------- ### Configure Nixd LSP settings Source: https://github.com/zed-extensions/nix/blob/main/README.md Configure the nixd language server in Zed's settings.json to suppress the 'sema-extra-with' diagnostic. See the Nixd LSP Configuration Docs for more options. ```json { "lsp": { "nixd": { "settings": { "diagnostic": { "suppress": [ "sema-extra-with" ] } } } } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.