feat(nvim): full-screen keybinding cheatsheet + release v3.0.0#130
Conversation
which-key answers "I pressed <leader>, what's next?" but not "what do I even have?" — so the config's ~30 lazy plugin specs accreted features faster than muscle memory could track. Add lua/gerrrt/cheatsheet.lua: a centered, NVChad- style floating panel that lays out every curated binding at once in task-grouped cards, masonry-packed into as many columns as the terminal is wide and themed via `default = true` highlight links so it degrades cleanly on a bare box. Bound to <leader>? (which-key's old buffer-local-keys popup moves to <leader>wk, now under a labelled `w` group) and exposed as :Cheatsheet / :Cheat; q/<Esc> close. Pure Neovim API, no new plugin dependency, require-d lazily so it costs nothing at startup. Hand-curated on purpose: most mappings bind lazily and aren't registered until their plugin loads, so scraping nvim_get_keymap() at open time would show a half-empty, load-order-dependent list. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TEMuYnYhX6vzBYcQVzGm9U
Bump core.version 2.6.0 → 3.0.0 and promote CHANGELOG [Unreleased] under a dated ## [v3.0.0] heading. MAJOR because <leader>? changes behavior — a public-binding repoint (per RELEASE-STRATEGY.md's SemVer mapping) — alongside the additive cheatsheet and the staged starship/repo-migration changes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TEMuYnYhX6vzBYcQVzGm9U
There was a problem hiding this comment.
Pull request overview
Adds a new Neovim “full-screen keybinding cheatsheet” UI and repoints the existing <leader>? help binding to open it, cutting a major v3.0.0 release to reflect the breaking keybinding change.
Changes:
- Introduce
gerrrt.cheatsheetmodule that renders a floating, multi-column keybinding panel. - Rewire keybinding entry points:
<leader>?opens the cheatsheet; which-key buffer-local popup moves to<leader>wk. - Bump
core.versionto3.0.0and promote changelog entries underv3.0.0.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| nvim/lua/gerrrt/plugins/which-key.lua | Adds a which-key group and moves buffer-local which-key popup to <leader>wk. |
| nvim/lua/gerrrt/config/keymaps.lua | Binds <leader>? to open the cheatsheet and adds :Cheatsheet / :Cheat commands. |
| nvim/lua/gerrrt/cheatsheet.lua | New module implementing the cheatsheet UI + rendering/layout logic. |
| core.version | Version bump to 3.0.0 for the breaking binding change. |
| CHANGELOG.md | Adds v3.0.0 entry documenting the cheatsheet and keybinding repoint. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| vim.api.nvim_create_user_command("Cheatsheet", function() | ||
| require("gerrrt.cheatsheet").open() | ||
| end, { desc = "Open the keybinding cheatsheet" }) |
There was a problem hiding this comment.
Leaving this (and the :Cheat twin) as-is. Unlike the :command Ex command, nvim_create_user_command defaults to force = true — it silently overwrites an existing command of the same name, so re-sourcing won't error. (It also isn't sourced on reload here: keymaps.lua is required once at startup, and require is cached.) Applied the other two comments — added <leader>wk to the cheatsheet table and clamped the float's inner size to columns-4/lines-4 so the rounded border can't overflow a tiny terminal — in 7c388ee.
Generated by Claude Code
| vim.api.nvim_create_user_command("Cheat", function() | ||
| require("gerrrt.cheatsheet").open() | ||
| end, { desc = "Open the keybinding cheatsheet" }) |
| { | ||
| "Essentials", | ||
| { "<leader>?", "Open this cheatsheet" }, | ||
| { "<leader>rc", "Edit init.lua" }, | ||
| { "<Esc>", "Clear search highlight" }, | ||
| { "<leader>pa", "Copy full file path" }, | ||
| { "<leader>p", "Paste over, keep yank (x)" }, | ||
| { "<leader>D", "Delete to black hole" }, | ||
| { "gc / gcc", "Comment motion / line" }, | ||
| }, |
| local width = math.min(content_w, vim.o.columns - 2) | ||
| local height = math.min(#lines, math.floor(vim.o.lines * 0.9)) | ||
| local win = vim.api.nvim_open_win(buf, true, { | ||
| relative = "editor", | ||
| width = width, | ||
| height = height, | ||
| row = math.floor((vim.o.lines - height) / 2), | ||
| col = math.floor((vim.o.columns - width) / 2), |
Address PR review: - The cheatsheet bills itself as the always-complete map but omitted the <leader>wk binding it introduced (which-key's relocated buffer-local popup). Add it to the Essentials card so the table stays in sync with the keymaps. - The rounded border makes the float 2 cells wider/taller than width×height, so on a tiny terminal `height = floor(lines*0.9)` could exceed the grid and make nvim_open_win error. Clamp inner size to columns-4 / lines-4 (border + margin); verified an 8×40 grid now yields a 4×36 float that fits. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TEMuYnYhX6vzBYcQVzGm9U
What & why
which-key is great at "I pressed
<leader>, now what?" — but useless for "whatdo I even have?". The config's ~30 lazy plugin specs have accreted features
faster than muscle memory can track, so this adds the other half: one
full-screen panel that lays out every curated binding at once, so you can
eyeball the whole surface area and rediscover what you're under-using.
And since this is a user-visible interface change that repoints a public binding,
it's the cut for v3.0.0.
The cheatsheet —
nvim/lua/gerrrt/cheatsheet.luaMotion & Search, Flash, Windows/Splits, Buffers, Tabs, Harpoon, Find (fzf),
LSP & Code, Trouble, the three Git groups, Debug (DAP), Test, Search & Replace,
Folds, Text objects & Surround, Sessions, UI & Toggles, Packages.
terminal is wide, so it stays rectangular from a 3-column laptop to a 5-column
ultrawide.
default = truehighlight links (Title / Constant / Comment), soit inherits tokyonight here and still reads correctly on a bare box.
require-d lazily so it costsnothing at startup.
until their plugin loads, so scraping
nvim_get_keymap()at open time wouldshow a half-empty, load-order-dependent list. The table is the intentional,
always-complete picture and lives beside the specs it mirrors, so a new binding
gets a new row in the same review.
Entry points
<leader>?or:Cheatsheet/:Cheatto open;q/<Esc>to close.<leader>?previously opened which-key's buffer-local-keyspopup. That popup moves to
<leader>wk(now under a labelledwgroup). Thewhole map is the more useful thing to keep on the mnemonic "help" key; the live
per-buffer prompt is one keystroke away.
Release v3.0.0
core.version2.6.0 → 3.0.0; CHANGELOG[Unreleased]promoted under## [v3.0.0] - 2026-07-02(fresh empty[Unreleased]opened).RELEASE-STRATEGY.md's SemVer mapping: repointing a public bindingis a breaking change a host adapts to. Rides alongside the additive cheatsheet
and the already-staged starship-timeout / repo-migration changes.
Verification
luacheckclean across all 86nvim/files;markdownlintclean on CHANGELOG../scripts/audit-core.sh→ 186 pass / 0 fail (skips are only tools absent inthis container: zsh, shellcheck, actionlint, gitleaks, and the headless-nvim
legs — all gated in CI).
vimAPI: 44 lines, 176highlight spans, 0 byte-offset overflows (valid even across the multibyte
box-drawing rules), masonry balanced across columns.
🤖 Generated with Claude Code
Generated by Claude Code