feat(neovim): install stuff about Terraform

This commit is contained in:
Yorick Barbanneau 2024-09-06 16:28:14 +02:00
parent 491c67e56b
commit 5994859096
2 changed files with 37 additions and 3 deletions

View file

@ -28,13 +28,17 @@ in
# LSP Servers # LSP Servers
clang-tools clang-tools
hadolint hadolint
helm-ls
lua-language-server lua-language-server
marksman marksman
nil nil
nodePackages.bash-language-server nodePackages.bash-language-server
python3Packages.python-lsp-server python3Packages.python-lsp-server
shellcheck shellcheck
# yaml-language-server
terraform-lsp
tflint
yaml-language-server
# Formatters # Formatters
nixfmt-rfc-style nixfmt-rfc-style
@ -115,12 +119,15 @@ in
p.cpp p.cpp
p.cmake p.cmake
p.dockerfile p.dockerfile
p.hcl
p.helm
p.latex p.latex
p.lua p.lua
p.llvm p.llvm
p.markdown p.markdown
p.markdown_inline p.markdown_inline
p.python p.python
p.terraform
p.vim p.vim
p.yaml p.yaml
]) ])
@ -158,6 +165,7 @@ in
type = "lua"; type = "lua";
config = ( builtins.readFile ./files/whichkey.lua ); config = ( builtins.readFile ./files/whichkey.lua );
} }
vim-helm
]; ];
}; };
}; };

View file

@ -2,6 +2,21 @@ local lspconfig = require('lspconfig')
lspconfig.bashls.setup {} lspconfig.bashls.setup {}
lspconfig.clangd.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 { lspconfig.lua_ls.setup {
single_file_support = true, single_file_support = true,
flags = { flags = {
@ -14,14 +29,25 @@ lspconfig.pylsp.setup {
settings = { settings = {
pylsp = { pylsp = {
plugins = { plugins = {
pylint = { pylint = {
enabled = true 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', { vim.api.nvim_create_autocmd('LspAttach', {
desc = 'LSP actions', desc = 'LSP actions',