Commit graph dotfiles/neovim/config/plugins/which-key.lua
Author SHA1 Message Date
Jonny Barnes
e8e9bf0663
Fix which-key not seeing gitsigns maps, add diagnostic maps
The gitsigns keymaps were defined in on_attach, so they were
buffer-local and created asynchronously - gitsigns shells out to git
before attaching. which-key had already built its keymap tree for the
buffer by then, and it only invalidates that cache on BufReadPost,
BufNew and LspAttach, so maps added afterwards stayed invisible.
Buf:get() returns cached mode state unless explicitly passed `update`,
which is why re-entering the buffer didn't help either.

Mapping globally instead means the maps exist before which-key builds
any tree. The gitsigns API no-ops in buffers it hasn't attached to
(checked stage/reset/preview/blame/nav in a non-git directory), so the
only change is that the maps now exist everywhere rather than just in
git-tracked buffers.

Also puts the diagnostic float and quickfix list on <leader>d. Nvim
already binds <C-W>d and ]d/[d for these, so this is a rebinding for
discoverability rather than new capability.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-08 17:27:37 +01:00
Jonny Barnes
5d0688c827
Add which-key and nvim-web-devicons, tidy brew casks
which-key needs an icon backend and treats mini.icons and
nvim-web-devicons as equally viable optional deps, so devicons covers
it. Both are pure APIs with no visible effect on their own; devicons
self-initialises on require, so no setup() call.

Group labels for the <leader>h and <leader>t prefixes live in the
which-key config rather than next to the gitsigns maps they describe,
keeping which-key's config in one place. Worth moving if more plugins
start contributing prefixes.

The Nerd Font the glyphs need was installed by hand on this machine
but missing from brew.sh, so a fresh bootstrap would have rendered
every icon as tofu. Records it as a cask alongside the ghostty
font-family setting that already expects it.

Also drops the claude-code cask, which was never actually installed
here: brew tracks stable releases, and we want newer ones, so it comes
from Claude's own installer instead. Left a comment so it doesn't get
re-added.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-08 14:26:59 +01:00