I've got this collection of mappings registered to wrap some tpope/vim-surround mappings, but whenever I use the WhichKey mappings they don't work. If I use the full mapping from vim-surround it does work. The other mappings defined in the same file work fine, it's just these ones that don't seem to work.
I was wondering if there's a way to debug mappings to better understand where the mapping is going wrong?
local wk = require("which-key")
wk.register({
['"'] = { 'ysiw"', "Wrap the word under the cursor in double quotes" },
["'"] = { "ysiw'", "Wrap the word under the cursor in single quotes" },
["("] = { "ysiw(", "Wrap the word under the cursor in brackets, but with spaces around the word" },
[")"] = { "ysiw)", "Wrap the word under the cursor in brackets" },
["["] = { "ysiw[", "Wrap the word under the cursor in square brackets, but with spaces around the word" },
["]"] = { "ysiw]", "Wrap the word under the cursor in square brackets" },
["{"] = { "ysiw{", "Wrap the word under the cursor in curly brackets, but with spaces around the word" },
["}"] = { "ysiw}", "Wrap the word under the cursor in curly brackets" },
["`"] = { "ysiw`", "Wrap the word under the cursor in backticks" },
}, {
prefix = "<leader>",
})
I've got this collection of mappings registered to wrap some tpope/vim-surround mappings, but whenever I use the WhichKey mappings they don't work. If I use the full mapping from vim-surround it does work. The other mappings defined in the same file work fine, it's just these ones that don't seem to work.
I was wondering if there's a way to debug mappings to better understand where the mapping is going wrong?