A Neovim plugin for displaying code coverage overlays directly in your editor with smart auto-loading and file watching.
The plugin supports any language that can generate coverage in one of the supported formats.
{
"mr-u0b0dy/crazy-coverage.nvim",
config = function()
require("crazy-coverage").setup()
end,
}
use {
"mr-u0b0dy/crazy-coverage.nvim",
config = function()
require("crazy-coverage").setup()
end,
}
See Installation Guide for other plugin managers and AstroVim setup.
-- Toggle coverage (auto-loads file, watches for changes)
:CoverageToggle
-- Navigate uncovered code
]cu " Next uncovered line
[cu " Previous uncovered line
What the toggle does:
The plugin intelligently finds your coverage file automatically. It:
Searches Standard Directories in order:
build/coverage/ - CMake build outputcoverage/ - Standard coverage directorybuild/ - Build directory root. - Project rootDetects by Content - Not just filenames:
*.lcov)Supports Any Filename:
✓ build/coverage_report (no extension)
✓ coverage_2025_01_09.json (custom name)
✓ results.xml (non-standard name)
✓ my_coverage_data (any name works)
You can customize the search directories in config:
require("crazy-coverage").setup({
coverage_dirs = {
"build/coverage", -- Search here first
".coverage", -- Custom location
"coverage",
".",
}
})
See Configuration Reference for more details.
require("crazy-coverage").setup({
default_show_hit_count = true, -- Show hit counts by default
virt_text_pos = "eol", -- "eol", "inline", "overlay", "right_align"
auto_adapt_colors = true, -- Auto-adapt colors to your theme
})
-- Right-aligned with branch coverage
require("crazy-coverage").setup({
virt_text_pos = "right_align",
show_branch_summary = true,
})
-- Custom colors (disable auto-adaptation)
require("crazy-coverage").setup({
auto_adapt_colors = false,
colors = {
covered = { bg = "#1a4d1a", fg = "#66ff66" },
uncovered = { bg = "#4d1a1a", fg = "#ff6666" },
partial = { bg = "#4d4d1a", fg = "#ffff66" },
},
})
-- Auto-adapt with one manual override
require("crazy-coverage").setup({
auto_adapt_colors = true, -- Adapt most colors
colors = {
uncovered = "#660000", -- But always use dark red for uncovered
},
})
See Configuration Reference for all 15+ options.
| Command | Description |
|---|---|
:CoverageToggle |
Toggle coverage overlay (auto-loads, watches file) |
:CoverageToggleHitCount |
Toggle hit count display |
:CoverageLoad <file> |
Manually load specific coverage file |
:CoverageNextUncovered |
Jump to next uncovered line |
:CoveragePrevCovered |
Jump to previous covered line |
:CoverageNextPartial |
Jump to next partially covered line |
See Usage Guide for keybindings and navigation.
Apache License 2.0 - Copyright © 2025 mr-u0b0dy
See Development Guide for testing and contribution guidelines.