From 59948590960ebef670b95812511b7be55ca2c78c Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Fri, 6 Sep 2024 16:28:14 +0200 Subject: [PATCH] feat(neovim): install stuff about Terraform --- modules/home-manager/cli/neovim/default.nix | 10 ++++++- .../cli/neovim/files/lspconfig.lua | 30 +++++++++++++++++-- 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/modules/home-manager/cli/neovim/default.nix b/modules/home-manager/cli/neovim/default.nix index 998b326..19d8962 100644 --- a/modules/home-manager/cli/neovim/default.nix +++ b/modules/home-manager/cli/neovim/default.nix @@ -28,13 +28,17 @@ in # LSP Servers clang-tools hadolint + helm-ls lua-language-server marksman nil nodePackages.bash-language-server python3Packages.python-lsp-server shellcheck - # yaml-language-server + + terraform-lsp + tflint + yaml-language-server # Formatters nixfmt-rfc-style @@ -115,12 +119,15 @@ in p.cpp p.cmake p.dockerfile + p.hcl + p.helm p.latex p.lua p.llvm p.markdown p.markdown_inline p.python + p.terraform p.vim p.yaml ]) @@ -158,6 +165,7 @@ in type = "lua"; config = ( builtins.readFile ./files/whichkey.lua ); } + vim-helm ]; }; }; diff --git a/modules/home-manager/cli/neovim/files/lspconfig.lua b/modules/home-manager/cli/neovim/files/lspconfig.lua index 6ddfddf..84fb126 100644 --- a/modules/home-manager/cli/neovim/files/lspconfig.lua +++ b/modules/home-manager/cli/neovim/files/lspconfig.lua @@ -2,6 +2,21 @@ local lspconfig = require('lspconfig') lspconfig.bashls.setup {} lspconfig.clangd.setup {} +lspconfig.helm_ls.setup{ + settings = { + ['helm-ls'] = { + logLevel = "info", + valuesFiles = { + mainValuesFile = "values.yaml", + lintOverlayValuesFile = "values.lint.yaml", + additionalValuesFilesGlobPattern = "values*.yaml" + } + }, + yamlls = { + enabled = false, + } + } +} lspconfig.lua_ls.setup { single_file_support = true, flags = { @@ -14,14 +29,25 @@ lspconfig.pylsp.setup { settings = { pylsp = { plugins = { - pylint = { + pylint = { enabled = true } } } } } -lspconfig.yamlls.setup{} +lspconfig.terraformls.setup{} +lspconfig.tflint.setup{} +lspconfig.yamlls.setup{ + settings = { + yaml = { + schemas = { + ["https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.30.0/all.json"] = {"k8s/**/*.yaml", "cluster/**/*.yaml",}, + ["https://taskfile.dev/schema.json"] = {"**/Taskfile.*", "**/taskfile.*",}, + }, + }, + }, +} vim.api.nvim_create_autocmd('LspAttach', { desc = 'LSP actions',