vim.diagnostics

Reference Neovim's diagnostics Lua API for managing and displaying diagnostic information.

232|4|Updated Jan 22, 2026
One-click install
npx skills add https://github.com/ThePrimeagen/skills --skill vim-diagnostics-theprimeagen
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vim.diagnostics
Source: https://github.com/ThePrimeagen/skills/tree/main/skills/vim.diagnostics
Command: npx skills add https://github.com/ThePrimeagen/skills --skill vim-diagnostics-theprimeagen

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a comprehensive reference for Neovim's diagnostics Lua API, enabling developers to effectively manage and interact with diagnostic information within Neovim.

Core Features & Use Cases

  • API Reference: Detailed documentation of functions, types, and helpers for Neovim's diagnostics.
  • Diagnostic Management: Utilities for filtering, sorting, and displaying diagnostics.
  • Use Case: A developer can quickly look up how to set or retrieve diagnostics for a specific buffer, or how to configure virtual text for displaying diagnostic messages.

Quick Start

Consult the documentation for the vim.diagnostic.get function to retrieve diagnostics for the current buffer.

Frequently Asked Questions about vim.diagnostics

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I get diagnostics for the current buffer in Neovim using Lua?

To get diagnostics for the current buffer in Neovim, use the `vim.diagnostic.get` Lua API function. This reference details how to retrieve, filter, and programmatically interact with linting and error reporting data.

What is the Neovim diagnostics API used for?

The Neovim diagnostics API is used to programmatically manage and display diagnostic information in Neovim. It provides Lua functions for setting, retrieving, and configuring how linting and error reporting features are visualized.

Can I configure virtual text for diagnostic messages in Neovim?

Yes, you can configure virtual text for diagnostic messages in Neovim. The diagnostics Lua API provides specific functions and configuration options to manage how diagnostic information is displayed directly within the editor.

Does the Neovim diagnostics API provide utilities for sorting and filtering errors?

Yes, the Neovim diagnostics API provides utilities for sorting and filtering errors. It includes Lua functions and helpers designed to manage, sort, and display diagnostic information effectively within Neovim.

How do I programmatically set diagnostics for a specific buffer in Neovim?

To programmatically set diagnostics for a specific buffer in Neovim, consult the diagnostics Lua API reference. It details the necessary functions and types for managing and assigning diagnostic information to buffers.