Compare commits

...

4 Commits

Author SHA1 Message Date
dc03420d3d nvim: Update other plugins 2025-09-12 02:09:12 +02:00
988793a4a4 nvim: Update schema-companion and kubernetes matcher 2025-09-12 02:08:50 +02:00
2dfbffb423 nvim: Switch back to fzf for fuzzy finding
Since I am now using fzf for a bunch of other things as well it made
sense to switch back in smart open as well.
2025-09-12 00:53:36 +02:00
037dd5af28 nvim: Update smart-open to fix pause when opening 2025-09-12 00:49:46 +02:00
8 changed files with 118 additions and 67 deletions

View File

@@ -9,14 +9,14 @@
"fidget.nvim": { "branch": "main", "commit": "4d5858bd4c471c895060e1b9f3575f1551184dc5" },
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
"gitsigns.nvim": { "branch": "main", "commit": "6e3c66548035e50db7bd8e360a29aec6620c3641" },
"gruvbox.nvim": { "branch": "main", "commit": "a56f758f9d3eed0b8afbab6ea3ee523887755aed" },
"gruvbox.nvim": { "branch": "main", "commit": "5e0a460d8e0f7f669c158dedd5f9ae2bcac31437" },
"guess-indent.nvim": { "branch": "main", "commit": "84a4987ff36798c2fc1169cbaff67960aed9776f" },
"inc-rename.nvim": { "branch": "main", "commit": "8ae25b35ae16ca4bd5de3d3c472eec3b574018d4" },
"kubernetes.nvim": { "branch": "main", "commit": "44daf998345628a1a7034e3aaa31f4e05e4dde7c" },
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
"lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" },
"lualine.nvim": { "branch": "master", "commit": "b8c23159c0161f4b89196f74ee3a6d02cdc3a955" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "5e085efe67fccb13372d54331d849219662a7e93" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "7f9a39fcd2ac6e979001f857727d606888f5909c" },
"mason-tool-installer.nvim": { "branch": "main", "commit": "517ef5994ef9d6b738322664d5fdd948f0fdeb46" },
"mason.nvim": { "branch": "main", "commit": "7dc4facca9702f95353d5a1f87daf23d78e31c2a" },
"neo-tree.nvim": { "branch": "v3.x", "commit": "f1deac7ecec88c28a250d890ba7bb35843e69cbd" },
@@ -24,27 +24,27 @@
"nvim-colorizer.lua": { "branch": "master", "commit": "51cf7c995ed1eb6642aecf19067ee634fa1b6ba2" },
"nvim-dap": { "branch": "master", "commit": "b0f983507e3702f073bfe1516846e58b56d4e42f" },
"nvim-dap-virtual-text": { "branch": "master", "commit": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6" },
"nvim-lspconfig": { "branch": "master", "commit": "3a8d621d74bd9760b9f8dbc4fdfb937bb13d2f49" },
"nvim-lspconfig": { "branch": "master", "commit": "d89f4891f0720cd2598e4bdd60010d8784b2ac8a" },
"nvim-surround": { "branch": "main", "commit": "a868c256c861044beb9794b4dd126480dcdfbdad" },
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "71385f191ec06ffc60e80e6b0c9a9d5daed4824c" },
"nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" },
"nvim-ts-autotag": { "branch": "main", "commit": "c4ca798ab95b316a768d51eaaaee48f64a4a46bc" },
"peek.nvim": { "branch": "master", "commit": "5820d937d5414baea5f586dc2a3d912a74636e5b" },
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
"ros-nvim": { "branch": "main", "commit": "1ad64cd3a1e144dfea67890845f9da2e82d96900" },
"schema-companion.nvim": { "branch": "main", "commit": "b22243d3ca71be08d06a4b9bf200c1d677c41d45" },
"schemastore.nvim": { "branch": "main", "commit": "2ae6d27897c60265d4ad3f33e286528d519098fd" },
"schema-companion.nvim": { "branch": "main", "commit": "e94f5f8439705d772363817c9d2c6c9fc7562bd0" },
"schemastore.nvim": { "branch": "main", "commit": "d522e3ed6ed2c7bed7ebe1e42615e79b3aabfe65" },
"scrollEOF.nvim": { "branch": "master", "commit": "aeedfad14e4a0cfa31b44b531c1ad8fd4696b551" },
"smart-open.nvim": { "branch": "0.2.x", "commit": "560d8f16e17977c8303db6f9660db58a4415ca41" },
"smart-splits.nvim": { "branch": "master", "commit": "1ac316e6ea719843fd80716d1105613c98632af1" },
"smart-open.nvim": { "branch": "0.3.x", "commit": "e7f27218bd43de5262d3e8e3e84a135737ca6942" },
"smart-splits.nvim": { "branch": "master", "commit": "51e400b0bb6cbfd48e56d1baca250f34028cf1d3" },
"snacks.nvim": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" },
"sqlite.lua": { "branch": "master", "commit": "50092d60feb242602d7578398c6eb53b4a8ffe7b" },
"telescope-fzy-native.nvim": { "branch": "master", "commit": "282f069504515eec762ab6d6c89903377252bf5b" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" },
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
"telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" },
"todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" },
"trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" },
"ultimate-autopair.nvim": { "branch": "v0.6", "commit": "2025a181c303cec0fabd4bbdc9d752574ceda2d9" },
"ultimate-autopair.nvim": { "branch": "v0.6", "commit": "74163ac321c7d208a5bb9cdf8964114c7064d6c7" },
"undotree": { "branch": "master", "commit": "fe9a9d0645f0f5532360b5e5f5c550d7bb4f1869" },
"which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }
}

View File

@@ -1,4 +1,11 @@
return {
return require("schema-companion").setup_client(
require("schema-companion").adapters.jsonls.setup({
sources = {
require("schema-companion").sources.lsp.setup(),
require("schema-companion").sources.none.setup(),
},
}),
{
settings = {
json = {
validate = { enable = true },
@@ -6,3 +13,4 @@ return {
},
},
}
)

View File

@@ -0,0 +1,9 @@
return require("schema-companion").setup_client(
require("schema-companion").adapters.taplo.setup({
sources = {
require("schema-companion").sources.lsp.setup(),
require("schema-companion").sources.none.setup(),
},
}),
{}
)

View File

@@ -1,5 +1,10 @@
return require("schema-companion").setup_client({
settings = {
yaml = {},
return require("schema-companion").setup_client(
require("schema-companion").adapters.yamlls.setup({
sources = {
require("matchers.kubernetes").setup({}),
require("schema-companion").sources.lsp.setup(),
require("schema-companion").sources.none.setup(),
},
})
}),
{}
)

View File

@@ -0,0 +1,57 @@
---@class schema_companion.Source
local M = {}
M.name = "Kubernetes"
M.config = {}
---@param config {}
---@return schema_companion.Source
function M.setup(config)
setmetatable(M, {})
M.config = vim.tbl_deep_extend("force", {}, M.config, config)
return M
end
function M:match(_, bufnr)
local resources = {}
local current = {}
for _, line in pairs(vim.api.nvim_buf_get_lines(bufnr, 0, -1, false)) do
local _, _, group, version = line:find([[^apiVersion:%s*["']?([^%s"'/]*)/?([^%s"']*)]])
local _, _, kind = line:find([[^kind:%s*["']?([^%s"'/]*)]])
if group and group ~= "" then
current.group = group
end
if version and version ~= "" then
current.version = version
end
if kind and kind ~= "" then
current.kind = kind
end
if current.group and current.kind then
table.insert(resources, current)
current = {}
end
end
local schemas = {}
for _, resource in pairs(resources) do
local api = resource.version and ("%s/%s"):format(resource.group, resource.version) or resource.group
local schema = {
name = ("%s@%s"):format(resource.kind, api),
source = M.name,
uri = require("kubernetes").yamlls_schema(),
}
if schema then
table.insert(schemas, schema)
end
end
return schemas
end
return M

View File

@@ -1,15 +1,15 @@
-- https://github.com/nvim-lualine/lualine.nvim
local function get_schema()
if vim.bo.filetype ~= "yaml" then
if not (vim.bo.filetype == "yaml" or vim.bo.filetype == "json" or vim.bo.filetype == "toml") then
return ""
end
local schema = require("schema-companion.context").get_buffer_schema()
if schema.name == "none" then
local schema = (require("schema-companion").get_current_schemas() or "none")
if schema == "none" then
return ""
end
return schema.name
return schema
end
--- @module "lazy"
@@ -43,9 +43,11 @@ return {
"encoding",
{ "fileformat", icons_enabled = false },
"filetype",
{
get_schema,
},
},
},
inactive_sections = {
lualine_c = {
{ "filename", path = 1 },

View File

@@ -1,33 +1,6 @@
-- https://github.com/cenk1cenk2/schema-companion.nvim
--- @module "schema-companion"
--- @type schema_companion.Matcher
local kubernetes = {
name = "Kubernetes",
match = function(bufnr)
local lines = vim.api.nvim_buf_get_lines(bufnr, 0, -1, false)
local kind = false
local api_version = false
for _, line in ipairs(lines) do
if kind or vim.regex("^kind: .*$"):match_str(line) then
kind = true
end
if api_version or vim.regex("^apiVersion: .*$"):match_str(line) then
api_version = true
end
if kind and api_version then
return {
name = "Kubernetes",
uri = require("kubernetes").yamlls_schema(),
}
end
end
return nil
end,
}
--- @module "lazy"
--- @type LazySpec
@@ -35,14 +8,13 @@ return {
"cenk1cenk2/schema-companion.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope.nvim",
"diogo464/kubernetes.nvim",
},
keys = {
{
"<leader>ys",
function()
require("telescope").extensions.schema_companion.select_schema()
require("schema-companion").select_schema()
end,
desc = "Yaml schema",
ft = "yaml",
@@ -50,11 +22,5 @@ return {
},
--- @module "schema-companion"
--- @type schema_companion.Config
opts = {
enable_telescope = true,
matchers = {
kubernetes,
},
schemas = {},
},
opts = {},
}

View File

@@ -37,6 +37,9 @@ return {
["ui-select"] = {
require("telescope.themes").get_dropdown(),
},
smart_open = {
match_algorithm = "fzf",
},
},
}
end,
@@ -114,24 +117,25 @@ return {
end,
},
{
"nvim-telescope/telescope-fzy-native.nvim",
"nvim-telescope/telescope-fzf-native.nvim",
build = "make",
dependencies = {
"nvim-telescope/telescope.nvim",
},
config = function()
require("telescope").load_extension("fzy_native")
require("telescope").load_extension("fzf")
end,
},
{
"danielfalk/smart-open.nvim",
branch = "0.2.x",
branch = "0.3.x",
config = function()
require("telescope").load_extension("smart_open")
end,
dependencies = {
"kkharji/sqlite.lua",
"nvim-telescope/telescope.nvim",
"nvim-telescope/telescope-fzy-native.nvim",
"nvim-telescope/telescope-fzf-native.nvim",
{
"ellisonleao/gruvbox.nvim",
opts = function(_, opts)