Skip to content

chore(nvim): close cheatsheet gaps, name which-key prefixes, drop dead config#259

Merged
Gerrrt merged 2 commits into
mainfrom
nvim-cheatsheet-and-dead-config
Jul 20, 2026
Merged

chore(nvim): close cheatsheet gaps, name which-key prefixes, drop dead config#259
Gerrrt merged 2 commits into
mainfrom
nvim-cheatsheet-and-dead-config

Conversation

@Gerrrt

@Gerrrt Gerrrt commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

The two deferred items from the second review pass: documentation drift and dead plugin config. No behaviour change except the harpoon guard.

Cheatsheet

The panel's header claims it lays out every curated binding. An audit against the real keymaps found it didn't — two entire features had no rows:

  • Completion (blink.cmp) — new card. The seven completion-menu keys (<C-Space>, <CR>, <C-k>/<C-j>, <C-e>, <C-b>/<C-f>, <Tab>/<S-Tab>) had no representation at all.
  • Move lines (mini.move) — new card for <A-hjkl>.

Also added <leader>bn/bp, <leader>cl (Trouble LSP refs/defs), ]t/[t, gsh, gsn.

Two descriptions corrected: <leader>rc said "Edit init.lua" where the keymap's desc is "Edit config"; <leader>e dropped the load-bearing "closes Zen if active" side effect.

The header now scopes its completeness claim — stating what is deliberately excluded (transient-UI keys: the rename float, oil buffers, alpha's buttons, the panel's own q/<Esc>) rather than overstating and drifting again.

which-key

<leader>r (edit config, rename symbol), <leader>o (organize imports) and <leader>p (copy file path) had real children but no group entry, so they rendered as bare unnamed prefixes. <leader>p is declared for normal mode only — in visual it is itself a mapping (paste-without-yank), not a prefix.

Dead config

Each verified against the installed plugin source, not assumed:

Change Why
bufferline: drop hover.reveal = { "close" } get_close_icon() (ui.lua:263-270) consults reveal, then unconditionally bails on if not options.show_buffer_close_icons then return endfalse here, so there was never a close icon to reveal. hover stays on for highlighting.
nvim-tree: adaptive_size = truewidth = {} A 2023-01-15 legacy key silently rewritten by legacy.lua:73-81; with no explicit width it yields { min = nil }, i.e. {}. Verified by running the migration and comparing deep-equal.
fidget: winblend 0 → 100 100 is fidget's default and its see-through setting; the old comment claimed 0 matched "transparent floats", which is backwards (notification/window.lua:33-49).
nvim-treesitter-context: drop separator = nil nil in a table literal omits the key, and nil is already the default — it read as a setting but did nothing.
conform: drop the config function It re-implemented lazy.nvim's default for a spec with opts. Verified the 20 formatters_by_ft entries still apply without it.
blink.cmp: fix a comment It claimed the snippet keys use native vim.snippet; with preset = "luasnip" they route to LuaSnip.

Harpoon

<leader>ha on an unnamed buffer stored an unnavigable empty entry and toasted a bare "Harpoon: added ". It now refuses with a warning.

Validation

Check Result
luacheck lua init.lua 0 warnings / 0 errors, 86 files
nvim --headless -c 'qa!' exit 0, no stderr
Cheatsheet opens renders 90 lines; asserted every new row is present
7 changed plugins force-loaded no errors in :messages
conform opts without explicit config 20 formatters_by_ft entries, lua -> { "stylua" }
make audit 222 pass / 0 fail

One audit check skipped (yaml parse — PyYAML not importable); environmental and pre-existing.

🤖 Generated with Claude Code

https://claude.ai/code/session_018wpwbjkGJKPFgvBFEKsFWE

…d config

Documentation drift and dead plugin config found by a second review pass. No
behaviour changes beyond the harpoon guard.

CHEATSHEET. The panel claims to lay out every curated binding; an audit against
the real keymaps found it did not. Added a Completion (blink.cmp) card — the
seven completion-menu keys had no row at all — and a Move lines (mini.move) card
for <A-hjkl>, another whole feature that was missing. Added <leader>bn/bp,
<leader>cl (Trouble LSP refs/defs), ]t/[t, gsh and gsn. Corrected two
descriptions: <leader>rc said "Edit init.lua" where the keymap's desc is "Edit
config", and <leader>e dropped the load-bearing "closes Zen if active" side
effect. The header's completeness claim is now scoped to state what is
deliberately excluded (transient-UI keys) instead of overstating.

WHICH-KEY. <leader>r, <leader>o and <leader>p had real children but no group
entry, so they rendered as bare unnamed prefixes. <leader>p is declared for
normal mode only — in visual it is itself a mapping (paste-without-yank), not a
prefix.

DEAD CONFIG, each checked against the installed plugin source rather than
assumed:
  • bufferline hover.reveal = { "close" } was unreachable — get_close_icon()
    (ui.lua:263-270) consults reveal and then unconditionally bails on
    `if not options.show_buffer_close_icons then return end`, which is false
    here. hover stays on for hover highlighting.
  • nvim-tree view.adaptive_size is a 2023-01-15 legacy key silently rewritten
    by legacy.lua:73-81; with no explicit width it yields { min = nil } i.e. {}.
    Verified equivalent by running the migration and comparing deep-equal, then
    written in the current spelling.
  • fidget winblend 0 -> 100 (its default). The old comment claimed 0 matched
    "transparent floats"; fidget's own docs describe 100 as the see-through
    setting and anything less as blending with what is underneath.
  • nvim-treesitter-context separator = nil did nothing: nil in a table literal
    omits the key and nil is already the default.
  • conform's config function re-implemented lazy.nvim's default for a spec with
    opts. Verified the 20 formatters_by_ft entries still apply without it.
  • blink.cmp comment claimed the snippet keys use native vim.snippet; with
    preset = "luasnip" they route to LuaSnip.

HARPOON. <leader>ha on an unnamed buffer stored an unnavigable empty entry and
toasted a bare "Harpoon: added ". It now refuses with a warning.

Validated: luacheck 0/0 across 86 files, clean headless boot, cheatsheet opens
and renders all new cards, the seven changed plugins force-load with no errors,
make audit 222 pass / 0 fail.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018wpwbjkGJKPFgvBFEKsFWE
Copilot AI review requested due to automatic review settings July 20, 2026 14:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Aligns Neovim documentation and plugin configuration with current behavior while preventing invalid Harpoon entries.

Changes:

  • Expands the cheatsheet and names missing which-key prefixes.
  • Removes redundant or legacy plugin configuration.
  • Rejects unnamed buffers when adding Harpoon entries.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
CHANGELOG.md Records Neovim changes.
nvim/lua/gerrrt/cheatsheet.lua Adds missing binding references.
nvim/lua/gerrrt/plugins/blink-cmp.lua Corrects snippet-engine commentary.
nvim/lua/gerrrt/plugins/bufferline-nvim.lua Removes unreachable hover reveal configuration.
nvim/lua/gerrrt/plugins/conform.lua Uses lazy.nvim’s default setup behavior.
nvim/lua/gerrrt/plugins/fidget-nvim.lua Restores the default transparent window blend.
nvim/lua/gerrrt/plugins/harpoon.lua Guards against unnamed buffers.
nvim/lua/gerrrt/plugins/nvim-tree.lua Replaces a legacy adaptive-width option.
nvim/lua/gerrrt/plugins/treesitter-context.lua Removes an ineffective nil option.
nvim/lua/gerrrt/plugins/which-key.lua Names three previously unnamed prefixes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread nvim/lua/gerrrt/cheatsheet.lua Outdated
{ "<C-e>", "Hide menu" },
{ "<C-b> / <C-f>", "Scroll docs up / down" },
{ "<Tab> / <S-Tab>", "Snippet: next / prev placeholder" },
{ "<C-s>", "Signature help (insert)" },
Comment thread nvim/lua/gerrrt/plugins/nvim-tree.lua Outdated
-- (nvim-tree.lua/lua/nvim-tree/legacy.lua:73-81): with no explicit width it produces
-- `width = { min = nil }`, i.e. exactly `{}`. Verified equivalent by running the
-- migration: `{ adaptive_size = true }` and `{ width = {} }` compare deep-equal.
-- An empty width table means "size to content, no fixed min/max".
…{} note

Both review comments on #259. Both were mistakes I introduced in that PR.

<C-s> does not belong in the Completion card. It is signature help, mapped in
utils/lsp.lua:121 — there are zero hits for it in blink's keymap block, which
ends at <S-Tab>. It was already listed in the LSP & Code card, so the new row
both duplicated it and contradicted that card's own note that every key in it is
set explicitly in the blink spec. Removed, with a comment recording why it is
not there (blink's signature window is automatic via signature.enabled and has
no key of its own). The two remaining <C-s> rows are distinct: Flash in
command-line search, and signature help in insert.

`view = { width = {} }` is not "no fixed min/max". The migration equivalence
still holds, but the explanation was wrong: nvim-tree fills the absent keys with
its own defaults — `width.min or DEFAULT_MIN_WIDTH` (30) and
`width.max or DEFAULT_MAX_WIDTH` (-1) at view-state.lua:5-6,77-78 — so the pane
sizes to content but never narrower than 30 columns. Confirmed at runtime:
Active.width = 30, max_width = -1. Comment and CHANGELOG both corrected.

Validated: luacheck 0/0 across 86 files, cheatsheet still renders 90 lines with
exactly the two legitimate <C-s> rows, make audit 222 pass / 0 fail.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018wpwbjkGJKPFgvBFEKsFWE
@Gerrrt

Gerrrt commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator Author

Both addressed in 44feda2. Both were mistakes I introduced in this PR.

1. <C-s> in the Completion card — correct, removed.

Confirmed: it's mapped at utils/lsp.lua:121, and blink's keymap block has zero occurrences of it (the block ends at <S-Tab>, as you said). It was already listed in the LSP & Code card, so the new row both duplicated it and contradicted that card's own note that every key in it is set explicitly in the blink spec.

Removed, with a comment recording why it isn't there — blink's signature window is automatic via signature.enabled and has no key of its own, which is what I'd confused it with.

The two remaining <C-s> rows are distinct and both correct: Flash in command-line search (c mode) and signature help (i mode). Verified in the rendered panel:

<C-s>  Toggle Flash in / search…
<C-s>  Signature help (i)
total C-s rows rendered = 2

2. width = {} is not "no fixed min/max" — correct, and my wording was wrong.

The migration equivalence still holds, but the explanation didn't. nvim-tree fills the absent keys with its own defaults — width.min or DEFAULT_MIN_WIDTH (30) and width.max or DEFAULT_MAX_WIDTH (-1) at view-state.lua:5-6,77-78. So the pane sizes to content but never narrower than 30 columns. Confirmed at runtime:

with width = {} -> Active.width = 30   max_width = -1

Both the inline comment and the CHANGELOG entry now say that, and point at where the defaults come from so the next reader doesn't have to take it on faith.

Worth noting the pattern: I verified the equivalence of the migration carefully and then wrote an unverified sentence about what the result means. Same failure mode as the vimade claim on #257 — checking one thing and asserting a neighbouring one.

Re-validated: luacheck 0/0 across 86 files, cheatsheet renders 90 lines, make audit 222 pass / 0 fail.

@Gerrrt
Gerrrt merged commit fc63e09 into main Jul 20, 2026
14 checks passed
@Gerrrt
Gerrrt deleted the nvim-cheatsheet-and-dead-config branch July 20, 2026 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants