summary refs log tree commit diff stats
path: root/user
diff options
context:
space:
mode:
authorAlan Pearce2024-06-01 20:08:09 +0200
committerAlan Pearce2024-06-02 14:20:54 +0200
commit7bde47a9659aaf83a5603fb0a362fa248e9e72e6 (patch)
tree542b2edde6bb47437dd27a7b83f61b44420252e2 /user
parent198a6cdd4ca5867702a8638ad2e51f2dffedd450 (diff)
downloadnixfiles-7bde47a9659aaf83a5603fb0a362fa248e9e72e6.tar.lz
nixfiles-7bde47a9659aaf83a5603fb0a362fa248e9e72e6.tar.zst
nixfiles-7bde47a9659aaf83a5603fb0a362fa248e9e72e6.zip
configure nil LSP settings correctly
Diffstat (limited to 'user')
-rw-r--r--user/emacs/init.el2
-rw-r--r--user/settings/neovim.nix18
2 files changed, 13 insertions, 7 deletions
diff --git a/user/emacs/init.el b/user/emacs/init.el
index 438e5487..ed221ce9 100644
--- a/user/emacs/init.el
+++ b/user/emacs/init.el
@@ -1113,7 +1113,7 @@ _C-k_: prev  _u_pper              _=_: upper/lower       _s_mart resolve
             (add-hook 'eglot-managed-mode-hook 'my/setup-eglot-eldoc)
             (setq-default eglot-workspace-configuration
                           '( :yaml (:keyOrdering nil)
-                             :nix (:autoArchive t)
+                             :nil (:nix (:flake (:autoArchive t)))
                              :gopls ( :staticcheck t
                                       :usePlaceholders t)))
             (defun my/eglot-capf ()
diff --git a/user/settings/neovim.nix b/user/settings/neovim.nix
index 315a309b..dcee5fde 100644
--- a/user/settings/neovim.nix
+++ b/user/settings/neovim.nix
@@ -31,16 +31,22 @@
       enable = true;
       settings = {
         "json.enable" = true;
-        "suggest.enablePreview" = true;
-        "coc.preferences.formatOnSaveFiletypes" = [ "nix" ];
-        "nil.formatting.command" = "nixpkgs-fmt";
-        semantictokens = {
-          filetypes = [ "nix" ];
-        };
         languageserver = {
           nix = {
             command = "${pkgs.nil}/bin/nil";
             filetypes = [ "nix" ];
+            rootPatterns = [ "flake.nix" ];
+            settings = {
+              coc.preferences.formatOnSaveFiletypes = [ "nix" ];
+              links.tooltip = true;
+              semanticTokens = {
+                filetypes = [ "nix" ];
+              };
+              nil = {
+                formatting.command = [ "nixpkgs-fmt" ];
+                nix.flake.autoArchive = true;
+              };
+            };
           };
           lua = {
             command = "${pkgs.lua-language-server}/bin/lua-language-server";