| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
A Neovim plugin that automatically detects and applies YAML schemas for your YAML files using yaml-language-server (yamlls). It can automatically fetch and apply Custom Resource Definition (CRD) schemas from your current Kubernetes cluster.
Using packer.nvim:
use {
'cwrau/yaml-schema-detect.nvim',
requires = {
'nvim-lua/plenary.nvim',
}
}Using lazy.nvim:
{
'cwrau/yaml-schema-detect.nvim',
---@module "yaml-schema-detect"
---@type YamlSchemaDetectOptions
opts = {}, -- use default options
dependencies = {
'nvim-lua/plenary.nvim',
},
ft = { "yaml", "helm" },
}Plugin ships with some sensible defaults which you can tweak in your own way.
{
disable_keymap = false,
keymap = {
refresh = "<leader>xr",
cleanup = "<leader>xyc",
info = "<leader>xyi",
},
}Using lazy.nvim:
Disable default keybindings entirely:
{
'cwrau/yaml-schema-detect.nvim',
---@module "yaml-schema-detect"
---@type YamlSchemaDetectOptions
opts = {
disable_keymap = true,
},
dependencies = {
'nvim-lua/plenary.nvim',
},
ft = { "yaml", "helm" },
}Change and toggle default keybindings:
{
'cwrau/yaml-schema-detect.nvim',
---@module "yaml-schema-detect"
---@type YamlSchemaDetectOptions
opts = {
keymap = {
refresh = "<leader>yr",
cleanup = "<leader>yc",
info = false,
},
},
dependencies = {
'nvim-lua/plenary.nvim',
},
ft = { "yaml", "helm" },
}The plugin works automatically once installed and configured. It will:
The plugin analyses your YAML files and dynamically updates the yaml-language-server or helm-ls configuration to use the most appropriate schema based on the file content and context. For Kubernetes Custom Resources, it automatically connects to your current cluster to fetch the corresponding CRD schemas, ensuring your YAML files are validated against the actual CRD definitions in your cluster.
| Back | FazBrowse Home | New Git URL |