mirror of
https://github.com/oxalica/nil.git
synced 2024-11-22 02:55:39 +03:00
Update docs examples to use nixfmt-rfc-style
This is now the chosen formatter for nixpkgs.
This commit is contained in:
parent
555d517d46
commit
9125bfeaff
@ -70,7 +70,7 @@ Merge this setting into your `coc-settings.json` (open with `:CocConfig`).
|
|||||||
// Uncomment these to tweak settings.
|
// Uncomment these to tweak settings.
|
||||||
// "settings": {
|
// "settings": {
|
||||||
// "nil": {
|
// "nil": {
|
||||||
// "formatting": { "command": ["nixpkgs-fmt"] }
|
// "formatting": { "command": ["nixfmt"] }
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
@ -108,7 +108,7 @@ Add the following elisp code to your configuration. (using `use-package`)
|
|||||||
:after (lsp-mode)
|
:after (lsp-mode)
|
||||||
:demand t
|
:demand t
|
||||||
:custom
|
:custom
|
||||||
(lsp-nix-nil-formatter ["nixpkgs-fmt"]))
|
(lsp-nix-nil-formatter ["nixfmt"]))
|
||||||
|
|
||||||
(use-package nix-mode
|
(use-package nix-mode
|
||||||
:hook (nix-mode . lsp-deferred)
|
:hook (nix-mode . lsp-deferred)
|
||||||
@ -144,7 +144,7 @@ Modify the extension's settings in your `settings.json`.
|
|||||||
// Uncomment these to tweak settings.
|
// Uncomment these to tweak settings.
|
||||||
// "nix.serverSettings": {
|
// "nix.serverSettings": {
|
||||||
// "nil": {
|
// "nil": {
|
||||||
// "formatting": { "command": ["nixpkgs-fmt"] }
|
// "formatting": { "command": ["nixfmt"] }
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
@ -88,7 +88,7 @@ let
|
|||||||
['nil'] = {
|
['nil'] = {
|
||||||
testSetting = 42,
|
testSetting = 42,
|
||||||
formatting = {
|
formatting = {
|
||||||
command = { "nixpkgs-fmt" },
|
command = { "nixfmt" },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -97,7 +97,7 @@ let
|
|||||||
nil.server.path = pkgs.writeShellScript "nil" ''
|
nil.server.path = pkgs.writeShellScript "nil" ''
|
||||||
exec "$NIL_PATH" "$@"
|
exec "$NIL_PATH" "$@"
|
||||||
'';
|
'';
|
||||||
nil.formatting.command = [ "${pkgs.nixpkgs-fmt}/bin/nixpkgs-fmt" ];
|
nil.formatting.command = [ (pkgs.lib.getExe pkgs.nixfmt-rfc-style) ];
|
||||||
nil.diagnostics.excludedFiles = [ "generated.nix" ];
|
nil.diagnostics.excludedFiles = [ "generated.nix" ];
|
||||||
nil.nix.flake.autoEvalInputs = true;
|
nil.nix.flake.autoEvalInputs = true;
|
||||||
nil.nix.maxMemoryMB = 2048;
|
nil.nix.maxMemoryMB = 2048;
|
||||||
|
@ -23,7 +23,7 @@ Default configuration:
|
|||||||
// External formatter command (with arguments).
|
// External formatter command (with arguments).
|
||||||
// It should accepts file content in stdin and print the formatted code into stdout.
|
// It should accepts file content in stdin and print the formatted code into stdout.
|
||||||
// Type: [string] | null
|
// Type: [string] | null
|
||||||
// Example: ["nixpkgs-fmt"]
|
// Example: ["nixfmt"]
|
||||||
"command": null,
|
"command": null,
|
||||||
},
|
},
|
||||||
"diagnostics": {
|
"diagnostics": {
|
||||||
|
@ -116,7 +116,7 @@ rec {
|
|||||||
|
|
||||||
jq
|
jq
|
||||||
pre-commit
|
pre-commit
|
||||||
nixpkgs-fmt
|
nixfmt-rfc-style
|
||||||
(import ./dev/nvim-lsp.nix { inherit pkgs; })
|
(import ./dev/nvim-lsp.nix { inherit pkgs; })
|
||||||
(import ./dev/vim-coc.nix { inherit pkgs; })
|
(import ./dev/vim-coc.nix { inherit pkgs; })
|
||||||
(import ./dev/vim-lsp.nix { inherit pkgs; })
|
(import ./dev/vim-lsp.nix { inherit pkgs; })
|
||||||
|
Loading…
Reference in New Issue
Block a user