From 29e40d0d3215d152475b276f7e27f4230a1a0983 Mon Sep 17 00:00:00 2001 From: Johannes Rothe Date: Sat, 21 Dec 2024 23:30:20 +0100 Subject: [PATCH] nvim: set terraform lsp root dir --- home/terminal/nixvim/default.nix | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/home/terminal/nixvim/default.nix b/home/terminal/nixvim/default.nix index 1d6bd21..f402af7 100644 --- a/home/terminal/nixvim/default.nix +++ b/home/terminal/nixvim/default.nix @@ -3,9 +3,7 @@ # TODO # Linter (ale) # Markdown spellcheck - # Autocomplete - # Missing plugins - # Language support for python, go, tofu, terraform, yaml + # Missing plugins from old vim config # Trailing spaces in statusline # Good example: https://github.com/fred-drake/neovim/blob/master/config/python/language.nix @@ -18,6 +16,7 @@ enable = true; extraPlugins = [ pkgs.vimPlugins.indentLine + pkgs.vimPlugins.nvim-lspconfig pkgs.vimPlugins.polyglot pkgs.vimPlugins.sonokai ]; @@ -72,7 +71,10 @@ }; lsp.servers.gopls.enable = true; lsp.servers.nixd.enable = true; - lsp.servers.terraformls.enable = true; + lsp.servers.terraformls = { + enable = true; + rootDir = "require('lspconfig.util').root_pattern('.git', '.terraform')"; + }; lsp.servers.tflint.enable = true; lsp.servers.yamlls.enable = true; lsp-format.enable = true; # Automatically format on save