# Neovim

`oxyaml` is a drop-in replacement for `yaml-language-server` (`yamlls`). Point `yamlls` at `oxyaml --stdio` and your existing `yamlls` / `yaml.*` settings (schemas, formatting, custom tags, modelines) keep working unchanged without Node.js.

> **Status:** Lua snippets below are **untested** with `nvim` in this environment (`nvim` is not installed locally).

## Prerequisites

[Install oxyaml](../../README.md#installation) and make sure `oxyaml` is on your `PATH`.

## nvim-lspconfig

### Neovim 0.11+ (`vim.lsp.config`)

Override `cmd` on the existing `yamlls` configuration (one-line change from `yaml-language-server`):

```lua
vim.lsp.config('yamlls', {
  cmd = { 'oxyaml', '--stdio' },
})
vim.lsp.enable('yamlls')
```

If you already pass `settings = { yaml = { ... } }` or `redhat = { telemetry = { enabled = false } }` to `vim.lsp.config('yamlls', ...)`, keep them as-is and add `cmd = { 'oxyaml', '--stdio' }`.

### Neovim 0.10 and earlier (`require('lspconfig')`)

```lua
require('lspconfig').yamlls.setup({
  cmd = { 'oxyaml', '--stdio' },
})
```

## mason.nvim

A `oxyaml` package for `mason-registry` is planned once release binaries are published. Until that registry entry is live:

- Install `oxyaml` on your `PATH` instead of installing `yaml-language-server` through Mason.
- If you use `mason-lspconfig.nvim`, keep `yamlls` out of `ensure_installed` (or avoid letting `mason-lspconfig` override `cmd` back to `yaml-language-server`).
