From 44cb60783d773951eb88723c1ab70d55d52a548a Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Tue, 9 Jul 2024 23:33:06 -0400 Subject: [PATCH] home/vscode: add nix lsp settings --- homeManagerModules/apps/vsCodium/default.nix | 27 +++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/homeManagerModules/apps/vsCodium/default.nix b/homeManagerModules/apps/vsCodium/default.nix index 0626653e..9420386c 100644 --- a/homeManagerModules/apps/vsCodium/default.nix +++ b/homeManagerModules/apps/vsCodium/default.nix @@ -14,12 +14,36 @@ "diffEditor.ignoreTrimWhitespace" = false; "editor.fontFamily" = "'NotoSansM Nerd Font', 'monospace', monospace"; "editor.fontSize" = lib.mkDefault 14; + "editor.formatOnPaste" = true; + "editor.formatOnSave" = true; + "editor.formatOnType" = true; "editor.rulers" = [80]; "explorer.confirmDelete" = false; "files.autoSave" = "afterDelay"; "git.autofetch" = true; "git.confirmSync" = false; - "nix.formatterPath" = lib.getExe pkgs.alejandra; + + "nix" = { + "enableLanguageServer" = true; + "formatterPath" = lib.getExe pkgs.alejandra; + "serverPath" = lib.getExe pkgs.nil; + + "serverSettings"."nil" = { + "diagnostics" = { + "ignored" = ["unused_binding" "unused_with"]; + }; + + "formatting" = { + "command" = ["${lib.getExe pkgs.alejandra}"]; + }; + }; + }; + + "[shellscript]" = { + "editor.defaultFormatter" = "foxundermoon.shell-format"; + }; + "shellformat.flag" = "-i 4"; + "terminal.external.linuxExec" = lib.getExe config.ar.home.defaultApps.terminal; "terminal.integrated.fontSize" = lib.mkDefault 14; "update.mode" = "none"; @@ -40,6 +64,7 @@ extensions = with pkgs.vscode-extensions; [ coolbear.systemd-unit-file + foxundermoon.shell-format github.vscode-github-actions github.vscode-pull-request-github jnoortheen.nix-ide