diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e91b50..db05e20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -215,6 +215,42 @@ commit (`git tag -a vX.Y.Z -m vX.Y.Z`). ### Changed (internal) +- **Neovim: the cheatsheet now covers what it claims to.** An audit against the real keymaps found + the panel had drifted from the config it documents. Added a **Completion (blink.cmp)** card — the + seven completion-menu keys had no row at all — and a **Move lines (mini.move)** card for + ``, another whole feature that was absent. Also added `bn`/`bp`, `cl` + (Trouble LSP refs/defs), `]t`/`[t`, `gsh` and `gsn`; corrected two descriptions (`rc` said + "Edit init.lua" where the keymap's `desc` is "Edit config"; `e` dropped the load-bearing + "closes Zen if active" side effect). The header's "EVERY curated binding" claim is now scoped to + say what is deliberately excluded (transient-UI keys: the rename float, oil buffers, alpha's + buttons, the panel's own `q`/``) rather than overstating. +- **Neovim: which-key names three prefixes that rendered as unnamed.** `r` (edit config, + rename symbol), `o` (organize imports) and `p` (copy file path) had real children + but no `group` entry. `p` is declared for normal mode only — in visual it is itself a + mapping (paste-without-yank), not a prefix. +- **Neovim: removed dead and misleading plugin config.** Each verified against the installed plugin + source, not assumed: + - `bufferline`: dropped `hover.reveal = { "close" }`. `get_close_icon()` + (`bufferline.nvim/lua/bufferline/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, so + there was never a close icon to reveal. `hover` stays on for hover highlighting. + - `nvim-tree`: `view = { adaptive_size = true }` → `view = { width = {} }`. `adaptive_size` is a + 2023-01-15 legacy key that nvim-tree silently rewrites (`legacy.lua:73-81`); with no explicit + width it produces `{ min = nil }`, i.e. `{}`. Verified equivalent by running the migration and + comparing deep-equal. Note `{}` is not "unbounded" — nvim-tree fills the absent keys with its + own defaults (`view-state.lua:5-6,77-78`), so the pane sizes to content but never narrower than + 30 columns; confirmed at runtime as `width = 30`, `max_width = -1`. + - `fidget`: `winblend = 0` → `100` (its default). The old comment said this matched "transparent + floats" — backwards; fidget's docs (`notification/window.lua:33-49`) describe `100` as the + see-through setting and anything less as blending with what's underneath. + - `nvim-treesitter-context`: dropped `separator = nil` — assigning `nil` in a table literal omits + the key, and `nil` is already the default, so it read as a setting but did nothing. + - `conform`: dropped a `config` function that re-implemented lazy.nvim's default for a spec with + `opts`. Verified the 20 `formatters_by_ft` entries still apply without it. + - `blink.cmp`: corrected a comment claiming the snippet keys use native `vim.snippet` — with + `preset = "luasnip"` they route to LuaSnip; blink picks the engine by preset. +- **Neovim: `ha` refuses an unnamed buffer.** harpoon keys its list by file path, so adding + a scratch buffer stored an unnavigable empty entry and toasted a bare `"Harpoon: added "`. - **Neovim: `keymaps.lua` Ex-command maps use `` instead of `:…`** (11 split/tab/ resize maps). `:` switches to cmdline-mode first — it echoes, is subject to cmdline mappings and abbreviations, and clobbers a pending count or visual selection; `` does not. diff --git a/nvim/lua/gerrrt/cheatsheet.lua b/nvim/lua/gerrrt/cheatsheet.lua index 12c2915..7a45b7a 100644 --- a/nvim/lua/gerrrt/cheatsheet.lua +++ b/nvim/lua/gerrrt/cheatsheet.lua @@ -6,9 +6,15 @@ -- eyeball the whole surface area and rediscover the features you're under-using. -- WHY HAND-CURATED : the mappings live across ~30 lazy specs, most bound lazily and not registered -- until their plugin loads — so scraping `nvim_get_keymap()` at open time would show a --- half-empty, load-order-dependent list. This table is the intentional, always-complete --- picture; when you add a binding to a plugin spec, add its row here too (they sit next to --- each other in review). Descriptions mirror the `desc =` on the real keymaps. +-- half-empty, load-order-dependent list. This table is the intentional picture; when you +-- add a binding to a plugin spec, add its row here too (they sit next to each other in +-- review). Descriptions mirror the `desc =` on the real keymaps. +-- SCOPE : "every curated binding" means every GLOBAL, user-facing one. Deliberately excluded, so +-- the panel stays a map rather than a dump: keys that only exist inside a transient UI +-- (the rename float, oil buffers, alpha's dashboard buttons, this panel's own q/) and +-- plain Vim motions that aren't config-specific. An audit found the panel had drifted — +-- mini.move's and the entire blink.cmp completion set were missing — so if you +-- are adding a card, prefer over-inclusion to a silent gap. -- ENTRY : `:Cheatsheet` (alias `:Cheat`) and `?` (see config/keymaps.lua). `q`/`` -- close; the panel is a throwaway scratch buffer, nothing to save. -- DEPS : none — pure Neovim API, so it survives on a bare box the same as the rest of Core. @@ -25,7 +31,7 @@ M.sections = { "Essentials", { "?", "Open this cheatsheet" }, { "wk", "Buffer-local keys" }, - { "rc", "Edit init.lua" }, + { "rc", "Edit config" }, { "", "Clear search highlight" }, { "pa", "Copy full file path" }, { "p", "Paste over, keep yank (x)" }, @@ -64,6 +70,7 @@ M.sections = { { "Buffers", { "]b / [b", "Next / previous" }, + { "bn / bp", "Next / previous (leader alias)" }, { "bj", "Pick (jump to letter)" }, { "bd", "Delete, keep layout" }, { "bP", "Pin / unpin" }, @@ -94,6 +101,7 @@ M.sections = { { "fh", "Help tags" }, { "fk", "Keymaps" }, { "ft", "Todo comments" }, + { "]t / [t", "Next / prev todo comment" }, { "fx / fX", "Diagnostics doc / workspace" }, { "fs / fw", "Symbols doc / workspace" }, }, @@ -113,6 +121,7 @@ M.sections = { { "cf", "Format buffer / range" }, { "cL", "Run CodeLens" }, { "cs", "Symbols (Trouble)" }, + { "cl", "LSP refs/defs (Trouble)" }, { "cn", "Annotation (Neogen)" }, { ";", "Breadcrumb pick (dropbar)" }, }, @@ -172,10 +181,32 @@ M.sections = { { "a/i + f c o", "func / class / block (TS)" }, { "gsa / gsd / gsr", "Surround add / del / replace" }, { "gsf / gsF", "Find surround right / left" }, + { "gsh", "Highlight surround" }, + { "gsn", "Update surround search range" }, { "]f / [f", "Next / prev function" }, { "]a / [a", "Next / prev argument" }, { "j", "Split / join block (treesj)" }, }, + { + -- mini.move (plugins/mini-nvim.lua). Normal mode moves the current LINE; visual mode moves + -- the SELECTION and keeps it selected. h/l also re-indent, which is why they earn a row. + "Move lines (mini.move)", + { " / ", "Move line/selection down / up" }, + { " / ", "Move line/selection left / right" }, + }, + { + -- blink.cmp (plugins/blink-cmp.lua). preset = "none", so every key here is set explicitly + -- in that spec — this card and that keymap block must be edited together. + "Completion (blink.cmp)", + { "", "Show menu / toggle docs" }, + { " / ", "Select previous / next item" }, + { "", "Accept selected item" }, + { "", "Hide menu" }, + { " / ", "Scroll docs up / down" }, + { " / ", "Snippet: next / prev placeholder" }, + -- NOT : that is signature help, mapped in utils/lsp.lua (LSP & Code card above), not by + -- blink. blink's signature window is automatic (signature.enabled) with no key of its own. + }, { "Sessions", { "qs", "Restore (this dir)" }, @@ -184,7 +215,7 @@ M.sections = { }, { "UI & Toggles", - { "e", "File tree (nvim-tree)" }, + { "e", "File tree (closes Zen if active)" }, { "-", "Parent dir (oil)" }, { "z", "Zen mode" }, { "U", "Undotree" }, diff --git a/nvim/lua/gerrrt/plugins/blink-cmp.lua b/nvim/lua/gerrrt/plugins/blink-cmp.lua index 39f9de4..289fe46 100644 --- a/nvim/lua/gerrrt/plugins/blink-cmp.lua +++ b/nvim/lua/gerrrt/plugins/blink-cmp.lua @@ -36,7 +36,10 @@ return { [""] = { "show", "show_documentation", "hide_documentation" }, [""] = { "hide", "fallback" }, [""] = { "accept", "fallback" }, - -- snippet jumps (blink uses the native vim.snippet engine under luasnip preset) + -- snippet jumps. NOTE: with `snippets.preset = "luasnip"` (above) these route to LuaSnip, + -- NOT to native vim.snippet — blink picks the engine by preset + -- (blink.cmp/lua/blink/cmp/config/snippets.lua:28-60). Switch the preset to "default" to + -- get vim.snippet. [""] = { "snippet_forward", "fallback" }, [""] = { "snippet_backward", "fallback" }, }, diff --git a/nvim/lua/gerrrt/plugins/bufferline-nvim.lua b/nvim/lua/gerrrt/plugins/bufferline-nvim.lua index 43d3750..0015fd9 100644 --- a/nvim/lua/gerrrt/plugins/bufferline-nvim.lua +++ b/nvim/lua/gerrrt/plugins/bufferline-nvim.lua @@ -147,7 +147,12 @@ return { separator = true, }, }, - hover = { enabled = true, delay = 150, reveal = { "close" } }, + -- No `reveal = { "close" }`: it is unreachable here. get_close_icon() + -- (bufferline.nvim/lua/bufferline/ui.lua:263-270) consults hover.reveal and then + -- unconditionally bails on `if not options.show_buffer_close_icons then return end` — + -- and that is false above, so no close icon is ever drawn to reveal. hover stays enabled + -- because bufferline still uses it for hover HIGHLIGHTING. + hover = { enabled = true, delay = 150 }, }, }, config = function(_, opts) diff --git a/nvim/lua/gerrrt/plugins/conform.lua b/nvim/lua/gerrrt/plugins/conform.lua index c056933..4a317cc 100644 --- a/nvim/lua/gerrrt/plugins/conform.lua +++ b/nvim/lua/gerrrt/plugins/conform.lua @@ -53,7 +53,7 @@ return { -- utils/lsp.lua disables bashls's LSP formatting so the "fallback" path can't shfmt it.) }, }, - config = function(_, opts) - require("conform").setup(opts) - end, + -- No `config` function: `config = function(_, opts) require("conform").setup(opts) end` is + -- byte-for-byte what lazy.nvim does by default for a spec that has `opts` and a main module, + -- so writing it out only invited drift. } diff --git a/nvim/lua/gerrrt/plugins/fidget-nvim.lua b/nvim/lua/gerrrt/plugins/fidget-nvim.lua index 99daa41..a33c78b 100644 --- a/nvim/lua/gerrrt/plugins/fidget-nvim.lua +++ b/nvim/lua/gerrrt/plugins/fidget-nvim.lua @@ -21,7 +21,14 @@ return { notification = { -- keep mini.notify as THE notifier; fidget only renders LSP progress. override_vim_notify = false, - window = { winblend = 0 }, -- match your transparent floats + -- winblend 100 is fidget's DEFAULT and is the fully see-through setting; its own docs + -- (fidget.nvim/lua/fidget/notification/window.lua:33-49) call anything under 100 the + -- blend-with-whatever-is-underneath case and "usually not desirable". The old comment + -- here ("match your transparent floats") had that backwards — 0 is the OPAQUE end. + -- Practically invisible either way under tokyonight (normal_hl = "Comment" carries no + -- bg), so keep the default rather than move away from it for a stated reason that was + -- the reverse of the truth. + window = { winblend = 100 }, }, }, } diff --git a/nvim/lua/gerrrt/plugins/harpoon.lua b/nvim/lua/gerrrt/plugins/harpoon.lua index b601b6c..03680f9 100644 --- a/nvim/lua/gerrrt/plugins/harpoon.lua +++ b/nvim/lua/gerrrt/plugins/harpoon.lua @@ -16,6 +16,14 @@ return { { "ha", function() + -- Guard the unnamed buffer: harpoon keys its list by file path, so adding a + -- scratch/[No Name] buffer stored an empty entry AND toasted a bare + -- "Harpoon: added " (expand("%:t") is "" there). Refuse instead of silently + -- polluting the list with a slot that can never be navigated back to. + if vim.api.nvim_buf_get_name(0) == "" then + vim.notify("Harpoon: buffer has no file to add", vim.log.levels.WARN) + return + end require("harpoon"):list():add() vim.notify("Harpoon: added " .. vim.fn.expand("%:t"), vim.log.levels.INFO) end, diff --git a/nvim/lua/gerrrt/plugins/nvim-tree.lua b/nvim/lua/gerrrt/plugins/nvim-tree.lua index 0acf09e..351755b 100644 --- a/nvim/lua/gerrrt/plugins/nvim-tree.lua +++ b/nvim/lua/gerrrt/plugins/nvim-tree.lua @@ -55,7 +55,17 @@ return { auto_open = true, }, filters = { dotfiles = false }, - view = { adaptive_size = true }, + -- `width = {}` is the current spelling of the old `adaptive_size = true` (a 2023-01-15 + -- legacy key). nvim-tree still accepts the old name but silently rewrites it + -- (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 does NOT mean "unbounded": nvim-tree fills in its own defaults + -- for the absent keys (view-state.lua:5-6,77-78) — `width.min or DEFAULT_MIN_WIDTH` (30) + -- and `width.max or DEFAULT_MAX_WIDTH` (-1, i.e. no cap). So the pane sizes to its + -- content but never narrower than 30 columns. Set `{ min = N }` / `{ max = N }` to + -- change either bound. + view = { width = {} }, }) end, } diff --git a/nvim/lua/gerrrt/plugins/treesitter-context.lua b/nvim/lua/gerrrt/plugins/treesitter-context.lua index 8d58e00..62f45f0 100644 --- a/nvim/lua/gerrrt/plugins/treesitter-context.lua +++ b/nvim/lua/gerrrt/plugins/treesitter-context.lua @@ -26,6 +26,9 @@ return { multiline_threshold = 1, -- collapse multiline signatures to a single line trim_scope = "outer", mode = "cursor", - separator = nil, + -- No `separator = nil` line: assigning nil in a table literal simply omits the key, and + -- nil is already the default (nvim-treesitter-context/lua/treesitter-context/config.lua:44) + -- — it read as a deliberate setting but did nothing. Set it to a string to draw a rule + -- under the context (which also makes it require 2+ lines above the cursorline). }, } diff --git a/nvim/lua/gerrrt/plugins/which-key.lua b/nvim/lua/gerrrt/plugins/which-key.lua index fd5aa12..0db0c48 100644 --- a/nvim/lua/gerrrt/plugins/which-key.lua +++ b/nvim/lua/gerrrt/plugins/which-key.lua @@ -35,6 +35,14 @@ return { { "w", group = "which-key" }, { "x", group = "trouble / lists" }, { "", group = "tabs" }, + -- These three had real children but no group entry, so which-key rendered them as bare + -- unnamed prefixes: r (rc = edit config, rn = rename symbol), o + -- (oi = organize imports), p (pa = copy file path). + { "r", group = "rename / config" }, + { "o", group = "organize" }, + -- normal mode only: in visual, p is itself a mapping (paste-without-yank, + -- config/keymaps.lua), not a prefix — declaring a group there would misdescribe it. + { "p", group = "path", mode = "n" }, -- non-leader: mini.surround moved here off `s` so flash owns `s` (see mini-nvim.lua) { "gs", group = "surround", mode = { "n", "x" } }, },