No description
Find a file
2025-12-03 20:20:54 +01:00
lua/nvim-k8s-crd fix project with chatgpt 2025-12-03 20:20:54 +01:00
LICENSE LICENSE 2024-06-04 23:03:57 +03:00
README.md fix: support neovin 0.11 LSP api (#6) 2025-05-26 23:49:26 +03:00

nvim-k8s-crd

nvim-k8s-crd is a Neovim plugin designed to synchronize Kubernetes Custom Resource Definitions (CRDs) with your Neovim setup, providing autosuggestions and schema validation for Kubernetes manifests based on the current context.

Features

  • Sync Kubernetes CRDs based on the current Kubernetes context.
  • Store CRD schemas locally.
  • Provide autosuggestions and schema validation for Kubernetes manifests.
  • Commands to sync schemas.

Installation

Using packer.nvim

use {
  'anasinnyk/nvim-k8s-crd',
  requires = { 'neovim/nvim-lspconfig' },
  config = function()
    require('nvim-k8s-crd').setup({
      cache_dir = "~/.cache/k8s-schemas/",  -- Local directory relative to the current working directory
      k8s = {
        file_mask = "*.yaml",
      },
    })
  end
}

Using lazy.nvim

use {
  'anasinnyk/nvim-k8s-crd',
  event = { "BufReadPre", "BufNewFile" }, -- or { 'BufEnter *.yaml' },
  dependencies = { 'neovim/nvim-lspconfig' },
  opts = {
    cache_dir = "~/.cache/k8s-schemas/",
    k8s = {
      file_mask = "*.yaml",
    }
  },
}

Configuration

require('nvim-k8s-crd').setup({
  cache_dir = "./.k8s-schemas/",  -- Local directory relative to the current working directory
  k8s = {
    file_mask = "*.yaml",  -- File mask to match Kubernetes manifests
  },
})

Setting k8s.file_mask to nil will disable the automatic matcher (you can use yaml-companion for setting a smarter matcher).

Commands

  • :K8SSchemasGenerate - Sync CRDs based on the current Kubernetes context.

License

MIT License