diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua new file mode 100644 index 0000000..a95915f --- /dev/null +++ b/.config/nvim/lua/plugins/lsp.lua @@ -0,0 +1,35 @@ +return { + { + "neovim/nvim-lspconfig", + opts = { + inlay_hints = { enabled = true }, + capabilities = { + workspace = { + didChangeWatchedFiles = { + dynamicRegistration = false, + }, + }, + }, + ---@type lspconfig.options + servers = { + yamlls = { + settings = { + yaml = { + schemas = { + kubernetes = "*.yaml", + ["http://json.schemastore.org/github-workflow"] = ".github/workflows/*", + ["http://json.schemastore.org/github-action"] = ".github/action.{yml,yaml}", + ["http://json.schemastore.org/ansible-stable-2.9"] = "roles/tasks/*.{yml,yaml}", + ["http://json.schemastore.org/kustomization"] = "kustomization.{yml,yaml}", + ["http://json.schemastore.org/chart"] = "Chart.{yml,yaml}", + ["https://json.schemastore.org/dependabot-v2"] = ".github/dependabot.{yml,yaml}", + ["https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/schemas/v3.1/schema.json"] = "*api*.{yml,yaml}", + ["https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.29.1/all.json"] = "/*.yaml", + }, + }, + }, + }, + }, + }, + }, +} diff --git a/.config/nvim/lua/plugins/yaml.lua b/.config/nvim/lua/plugins/yaml.lua deleted file mode 100644 index d14f2a4..0000000 --- a/.config/nvim/lua/plugins/yaml.lua +++ /dev/null @@ -1,25 +0,0 @@ -return { - { - "someone-stole-my-name/yaml-companion.nvim", - dependencies = { - { "neovim/nvim-lspconfig" }, - { "nvim-lua/plenary.nvim" }, - { "nvim-telescope/telescope.nvim" }, - }, - config = function() - require("yaml-companion").setup() - require("telescope").load_extension("yaml_schema") - local cfg = require("yaml-companion").setup({ - -- Add any options here, or leave empty to use the default settings - -- Additional schemas available in Telescope picker - schemas = { - { - name = "Kubernetes 1.25.9", - uri = "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.25.9-standalone-strict/all.json", - }, - }, - }) - require("lspconfig")["yamlls"].setup(cfg) - end, - }, -}