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 = { debounce_text_changes = 150, } } lspconfig.marksman.setup{} lspconfig.nil_ls.setup {} lspconfig.pylsp.setup { settings = { pylsp = { plugins = { pylint = { enabled = true } } } } } 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', callback = function() local bufmap = function(mode, lhs, rhs) local opts = {buffer = true} vim.keymap.set(mode, lhs, rhs, opts) end -- Displays hover information about the symbol under the cursor bufmap('n', 'K', 'lua vim.lsp.buf.hover()') -- Jump to the definition bufmap('n', 'gd', 'lua vim.lsp.buf.definition()') -- Jump to declaration bufmap('n', 'gD', 'lua vim.lsp.buf.declaration()') -- Lists all the implementations for the symbol under the cursor bufmap('n', 'gi', 'lua vim.lsp.buf.implementation()') -- Jumps to the definition of the type symbol bufmap('n', 'go', 'lua vim.lsp.buf.type_definition()') -- Lists all the references bufmap('n', 'gr', 'lua vim.lsp.buf.references()') -- Displays a function's signature information bufmap('n', 'gs', 'lua vim.lsp.buf.signature_help()') -- Renames all references to the symbol under the cursor bufmap('n', '', 'lua vim.lsp.buf.rename()') -- Selects a code action available at the current cursor position bufmap('n', '', 'lua vim.lsp.buf.code_action()') bufmap('x', '', 'lua vim.lsp.buf.range_code_action()') -- Show diagnostics in a floating window bufmap('n', 'gl', 'lua vim.diagnostic.open_float()') -- Move to the previous diagnostic bufmap('n', '[d', 'lua vim.diagnostic.goto_prev()') -- Move to the next diagnostic bufmap('n', ']d', 'lua vim.diagnostic.goto_next()') end })