highlight_ranges
Highlight multiple line ranges across open Neovim buffers in a single call. Visual annotations stack without altering file content.
Instructions
Add colored line highlights to one or more Neovim buffers in a single call. This is a visual annotation only — it does not modify buffer content and is not persisted to disk. Highlights stack; calling this adds more highlights without removing previous ones.
highlights: a list of dicts. Each dict requires:
file: path relative to Neovim's cwd (as shown in
get_state). The buffer must be open in Neovim.start_line: first line (1-indexed, inclusive).
end_line: last line (1-indexed, inclusive).
color (optional): hex color (e.g. "#5f3a3a") or Neovim highlight group name (e.g. "Comment", "DiagnosticError"). For groups, the resolved foreground color becomes the line background. Defaults to "Comment". Unknown names (including bare color literals like "Red") return an error. Out-of-range lines are clamped.
Use this when you need to highlight several ranges at once (possibly
across different files). Use highlight_range for a single range.
Use clear_highlights to remove all highlights from a buffer.
Returns a list of {highlighted} results in the same order as the input. Raises an error if any item is missing required keys.
Example: [{"file": "foo.py", "start_line": 1, "end_line": 3, "color": "DiagnosticError"}, {"file": "foo.py", "start_line": 10, "end_line": 12}]
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| highlights | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |