explaingit

iilw/nui-diagnostic.nvim

14LuaAudience · developerComplexity · 2/5LicenseSetup · easy

TLDR

A Neovim plugin that shows code errors and available fixes in floating popups as you navigate between diagnostics, letting you apply fixes by pressing a number key.

Mindmap

mindmap
  root((repo))
    What it does
      Jump between errors
      Floating error popup
      Code actions popup
      Number key to fix
    Tech stack
      Lua
      Neovim 0.10+
      nui.nvim library
    Setup
      lazy.nvim support
      vim.pack support
      Health check built in
    Customization
      Border and size
      Key mappings
      Action filtering
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Jump through code errors one by one and instantly see fix suggestions without leaving your editor.

USE CASE 2

Apply language server code fixes by pressing a number key instead of navigating menus.

USE CASE 3

Customize how diagnostic popups look and behave to match your Neovim setup.

Tech stack

LuaNeovimnui.nvim

Getting it running

Difficulty · easy Time to first run · 5min

Requires Neovim 0.10+ and nui.nvim as a dependency. One setup() call via lazy.nvim or vim.pack is all that's needed.

MIT license, free to use, modify, and share in any project, personal or commercial.

In plain English

This is a plugin for Neovim, a text editor used mainly by developers. The plugin improves how Neovim shows errors and warnings in your code, and how you act on them. When a language server (a background process that understands your programming language) finds a problem in your code, Neovim normally stores that information as a diagnostic. This plugin gives you a way to jump between those diagnostics one at a time, and as you land on each one, it opens a small floating popup showing the message. A second popup appears alongside it listing the available code actions, which are fixes or refactors the language server is offering for that problem. You pick an action by pressing the corresponding number key. The plugin depends on nui.nvim, a library for building popup windows in Neovim. Both popups close automatically when you move the cursor or enter insert mode. You can also close them manually with the Escape key. Setup is a single call to the setup function, which can be done through lazy.nvim or vim.pack, the two common plugin managers. Key mappings for navigating to the next and previous diagnostic, or specifically to the next and previous error, can be enabled through a configuration option or set manually. The appearance of the popups is configurable: border style, width, height, wrapping, and transparency. You can also control how many code actions are shown, whether disabled actions are included, and which number keys trigger them. A built-in health check command lets you verify the plugin and its dependencies are set up correctly. The plugin requires Neovim 0.10 or later and is released under the MIT license.

Copy-paste prompts

Prompt 1
I'm using the nui-diagnostic.nvim Neovim plugin. Write a lazy.nvim config snippet that installs it, sets up key mappings for next/previous error, and sets a rounded border style for the popups.
Prompt 2
Using nui-diagnostic.nvim in Neovim, how do I configure it to hide disabled code actions and limit the popup to showing only 5 actions at a time?
Prompt 3
I installed nui-diagnostic.nvim but the popups aren't appearing when I navigate to a diagnostic. Walk me through running the built-in health check and what common setup issues to look for.
Prompt 4
Write a Neovim Lua config that sets up nui-diagnostic.nvim with custom key mappings: ]e for next error, [e for previous error, and ]d/[d for any diagnostic.
Open on GitHub → Explain another repo

← iilw on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.