folke / which-key.nvim

💥 Create key bindings that stick. WhichKey helps you remember your Neovim keymaps, by showing available keybindings in a popup as you type.
Apache License 2.0
4.85k stars 157 forks source link

Debug mappings? #198

Closed neanias closed 3 days ago

neanias commented 2 years ago

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>",
})
github-actions[bot] commented 1 week ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.