Did you check docs and existing issues?
Neovim version (nvim -v)
v0.12.2
Operating system/version
Archlinux
Describe the bug
The proxy option in wk.add() does not respect noremap, which causes conflicts when remapping <C-w>.
Steps To Reproduce
- Inside
require("which-key").add({})
- Add
{ "<C-w>", "<C-w>q", noremap = true }
- Add
{ "<leader>w", proxy = "<C-w>", noremap = true }
- Run
nvim
- Type
<leader>w
- The current buffer closes
Expected Behavior
Because noremap is set, the proxy should directly send <C-w> to vim instead of going through the { "<C-w>", "<C-w>q", noremap = true } mapping
Health
- ✅ OK Most of these checks are for informational purposes only.
WARNINGS should be treated as a warning, and don't necessarily indicate a problem with your config.
Please |DON'T| report these warnings as an issue.
Checking your config ~
- ⚠️ WARNING |mini.icons| is not installed
- ✅ OK |nvim-web-devicons| is installed
Checking for issues with your mappings ~
- ✅ OK No issues reported
checking for overlapping keymaps ~
- ⚠️ WARNING In mode `n`, <gc> overlaps with <gcc>:
- <gc>: Toggle comment
- <gcc>: Toggle comment line
- ✅ OK Overlapping keymaps are only reported for informational purposes.
This doesn't necessarily mean there is a problem with your config.
Checking for duplicate mappings ~
- ✅ OK No duplicate mappings found
Log
Repro
vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()
require("lazy.minit").repro({
spec = {
{ "folke/which-key.nvim", opts = {} },
},
})
require("which-key").add({
{ "<C-w>", "<C-w>q", noremap = true },
{ "<leader>w", proxy = "<C-w>", noremap = true },
})
-- this is just what I use
vim.g.mapleader = " "
Did you check docs and existing issues?
Neovim version (nvim -v)
v0.12.2
Operating system/version
Archlinux
Describe the bug
The
proxyoption inwk.add()does not respectnoremap, which causes conflicts when remapping<C-w>.Steps To Reproduce
require("which-key").add({}){ "<C-w>", "<C-w>q", noremap = true }{ "<leader>w", proxy = "<C-w>", noremap = true }nvim<leader>wExpected Behavior
Because
noremapis set, the proxy should directly send<C-w>toviminstead of going through the{ "<C-w>", "<C-w>q", noremap = true }mappingHealth
Log
Repro