Neovim Diagnostics API Reference

SkillDev tools

A skill for dev tools by theprimeagen.

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the Neovim Diagnostics API Reference skill

What this skill tells your AI

The instructions your AI receives, as published by theprimeagen/skills in skills/vim.diagnostics/SKILL.md and read by ahel’s review.

This document contains function definitions for Neovim's diagnostics Lua API. Use this as a reference when working with diagnostics in Neovim Lua.


diagnostic

vim.diagnostic APIs, types, and helpers.

function get_qf_id_for_title(title)
function __newindex(t, name, handler)
function __index(t, bufnr)
function callback()
function to_severity(severity)
function severity_predicate(severity)
function filter_by_severity(severity, diagnostics)
function count_sources(bufnr)
function prefix_source(diagnostics)
function reformat_diagnostics(format, diagnostics)
function enabled_value(option, namespace)
function resolve_optional_value(option, value, namespace, bufnr)
function get_resolved_options(opts, namespace, bufnr)
function make_highlight_map(base_name)
function diagnostic_lines(diagnostics)
function diagnostics_at_cursor(diagnostics)
function set_diagnostic_cache(namespace, bufnr, diagnostics)
function restore_extmarks(bufnr, last)
function save_extmarks(namespace, bufnr)
function on_lines(_, _, _, _, _, last)
function on_detach()
function severity_to_extmark_priority(priority, opts)
function make_augroup_key(namespace, bufnr)
function execute_scheduled_display(namespace, bufnr)
function schedule_display(namespace, bufnr, args)
function clear_scheduled_display(namespace, bufnr)
function get_diagnostics(bufnr, opts, clamp)
function __index(t, k)
function add(b, d)
function add_all_diags(buf, diags)
function set_list(loclist, opts)
function filter_highest(diagnostics)
function next_diagnostic(search_forward, opts)
function sort_diagnostics(a, b)
function is_next(d)
function goto_diagnostic(diagnostic, opts)
function M.config(opts, namespace)
function M.set(namespace, bufnr, diagnostics, opts)
function M.get_namespace(namespace)
function M.get_namespaces()
function M.get(bufnr, opts)
function M.count(bufnr, opts)
function M.get_prev(opts)
function M.get_prev_pos(opts)
function M.goto_prev(opts)
function M.get_next(opts)
function M.get_next_pos(opts)
function M.jump(opts)
function M.goto_next(opts)
function show(namespace, bufnr, diagnostics, opts)
function hide(namespace, bufnr)
function render_virtual_text(namespace, bufnr, diagnostics, opts)
function distance_between_cols(bufnr, lnum, start_col, end_col)
function render_virtual_lines(namespace, bufnr, diagnostics)
function format_virtual_lines(diagnostic)
function M._get_virt_text_chunks(line_diags, opts)
function M.hide(namespace, bufnr)
function M.is_enabled(filter)
function M.is_disabled(bufnr, namespace)
function M.show(namespace, bufnr, diagnostics, opts)
function M.open_float(opts, ...)
function M.reset(namespace, bufnr)
function M.setqflist(opts)
function M.setloclist(opts)
function M.disable(bufnr, namespace)
function M.enable(enable, filter)
function __index()
function M.match(str, pat, groups, severity_map, defaults)
function M.toqflist(diagnostics)
function M.fromqflist(list)

Signals

GitHub stars
233
Forks
5
Last commit
Feb 2026
Advanced
Catalog kind
skill
Gateway key
vim-diagnostics-theprimeagen
Source
github.com/theprimeagen/skills