diff --git a/.config/nvim/lua/core/lazy.lua b/.config/nvim/lua/core/lazy.lua index d6166bf..e8bd3d7 100644 --- a/.config/nvim/lua/core/lazy.lua +++ b/.config/nvim/lua/core/lazy.lua @@ -177,30 +177,7 @@ require("lazy").setup({ { "f-person/git-blame.nvim" }, -- YAML - { - "someone-stole-my-name/yaml-companion.nvim", - ft = { "yaml" }, - opts = { - lspconfig = { - settings = { - redhat = { - telemetry = { - enabled = false, - }, - }, - -- yaml = { - -- schemas = { - -- ["https://custom/github-workflow.json"] = "/.github/workflows/*", - -- }, - -- }, - }, - }, - }, - config = function(_, opts) - local cfg = require("yaml-companion").setup(opts) - require("lspconfig")["yamlls"].setup(cfg) - end, - }, + { "b0o/schemastore.nvim" }, -- DAP { "mfussenegger/nvim-dap", event = "VeryLazy", version = "0.*" }, diff --git a/.config/nvim/lua/plugins/blink.lua b/.config/nvim/lua/plugins/blink.lua index 812924d..7bb2c3e 100644 --- a/.config/nvim/lua/plugins/blink.lua +++ b/.config/nvim/lua/plugins/blink.lua @@ -22,9 +22,9 @@ require("blink.cmp").setup({ window = { border = "single" }, }, menu = { - -- don't show completion menu automatically when searching + auto_show = function(ctx) - return ctx.mode ~= "cmdline" or not vim.tbl_contains({ "/", "?" }, vim.fn.getcmdtype()) + return vim.fn.getcmdtype() == ":" end, border = "single", diff --git a/.config/nvim/lua/plugins/lsp/mason.lua b/.config/nvim/lua/plugins/lsp/mason.lua index 559a5bd..17b2240 100644 --- a/.config/nvim/lua/plugins/lsp/mason.lua +++ b/.config/nvim/lua/plugins/lsp/mason.lua @@ -34,9 +34,8 @@ require("mason-lspconfig").setup({ automatic_installation = true, }) -local lspconfig = require("lspconfig") for _, server in pairs(servers) do - if server ~= "yamlls" then + if server ~= "ty" then local opts = { capabilities = require("blink.cmp").get_lsp_capabilities(), } @@ -49,6 +48,6 @@ for _, server in pairs(servers) do opts = vim.tbl_deep_extend("force", conf_opts, opts) end - lspconfig[server].setup(opts) + vim.lsp.config(server, opts) end end diff --git a/.config/nvim/lua/plugins/lsp/settings/yamlls.lua b/.config/nvim/lua/plugins/lsp/settings/yamlls.lua new file mode 100644 index 0000000..55d68d1 --- /dev/null +++ b/.config/nvim/lua/plugins/lsp/settings/yamlls.lua @@ -0,0 +1,33 @@ +return { + -- Have to add this for yamlls to understand that we support line folding + capabilities = { + textDocument = { + foldingRange = { + dynamicRegistration = false, + lineFoldingOnly = true, + }, + }, + }, + -- lazy-load schemastore when needed + before_init = function(_, new_config) + new_config.settings.yaml.schemas = + vim.tbl_deep_extend("force", new_config.settings.yaml.schemas or {}, require("schemastore").yaml.schemas()) + end, + positos = {}, + settings = { + redhat = { telemetry = { enabled = false } }, + yaml = { + keyOrdering = false, + format = { + enable = true, + }, + validate = true, + schemaStore = { + -- disable built-in schemaStore support + enable = false, + -- Avoid TypeError: Cannot read properties of undefined (reading 'length') + url = "", + }, + }, + }, +} diff --git a/.config/nvim/lua/plugins/lualine.lua b/.config/nvim/lua/plugins/lualine.lua index 0421190..ef0e888 100644 --- a/.config/nvim/lua/plugins/lualine.lua +++ b/.config/nvim/lua/plugins/lualine.lua @@ -49,21 +49,6 @@ local venv = function() return "" end -local get_filetype = function() - local ft = vim.bo.filetype or "" - - if ft == "yaml" then - local schema = require("yaml-companion").get_buf_schema(0) - if not schema or not schema.result or not schema.result[1].name then - return ft - end - - return ft .. " (" .. schema.result[1].name .. ")" - else - return ft - end -end - local gitblame = require("gitblame") vim.g.gitblame_date_format = "%r" @@ -170,7 +155,12 @@ require("lualine").setup({ diff, spaces, "encoding", - { get_filetype, separator = "" }, + { + "filetype", + colored = false, + icon_only = false, + icon = { align = "left" }, + }, }, lualine_y = { "progress" }, lualine_z = { "location" }, diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua index 0a817ec..6b72f91 100644 --- a/.config/nvim/lua/plugins/telescope.lua +++ b/.config/nvim/lua/plugins/telescope.lua @@ -39,4 +39,3 @@ telescope.setup({ telescope.load_extension("fzf") telescope.load_extension("ui-select") -telescope.load_extension("yaml_schema")