Short answer
Yes – you can change the icons that WhichKey itself uses (breadcrumb / separator / group) and you can attach an icon to every mapping label you register or override.
No – there isn’t a magical “add 💯 icons to every stock Vim mapping” switch; you have to register (or patch) the labels you care about.
──────────────────────────────────────────────────────────────
- UI-level icons (breadcrumb, separator, group)
──────────────────────────────────────────────────────────────
-- lua/plugins/whichkey.lua
require("which-key").setup({
icons = {
breadcrumb = "»", -- the key sequence so far
separator = "", -- between key and label
group = "", -- for grouped maps
},
})
Those three are the only icons that WhichKey draws by itself; tweak them once and forget about it.
──────────────────────────────────────────────────────────────
2. Adding icons to (or renaming) your mappings
──────────────────────────────────────────────────────────────
local wk = require("which-key")
wk.register({
["<leader>"] = {
f = { name = " Find" }, -- shows as “ Find”
s = { ":w<CR>", " Save file" }, -- shows as “ Save file”
},
})
Just put the glyph/emoji in the label string.
──────────────────────────────────────────────────────────────
3. Overriding the built-in “preset” labels
──────────────────────────────────────────────────────────────
WhichKey ships with default labels for things like g, z, <C-w>, …
You can patch those tables before you call setup:
local presets = require("which-key.plugins.presets")
presets.windows.name = " window"
presets.g.name = " goto"
presets.z.name = " folds"
Done – every time WhichKey shows the g group you’ll get your iconified
label, while the individual key descriptions (gd, g~, …) stay intact.
──────────────────────────────────────────────────────────────
4. “Can I auto-decorate all default mappings?”
──────────────────────────────────────────────────────────────
Not really.
WhichKey only shows what you (or its presets) register.
If you want an icon for a specific vanilla mapping (yw, d{, …) you’ll have
to register a label for it yourself; Otherwise WhichKey falls back to the
basic • placeholder.
──────────────────────────────────────────────────────────────
Quick checklist
──────────────────────────────────────────────────────────────
• Set icons = { … } inside setup → changes WhichKey UI glyphs
• Put glyphs in mapping labels when you register → icons per mapping
• Patch require("which-key.plugins.presets") → change default groups
• There’s no global auto-iconizer for every built-in Vim command.
That’s all there is to it — happy icon-sprinkling!