which-key.nvim icon indicating copy to clipboard operation
which-key.nvim copied to clipboard

[Question]: Operator black hole not registering

Open lmburns opened this issue 3 years ago • 0 comments

All of the other operators (i.e, g, y, c, and v) work just fine. However, I have remapped d to "_d because I do not want to copy what I delete to my clipboard, and the operator window will not appear unless the mapping is removed.

I've tried the following:

  1. Placing the mapping before and after this
local presets = require("which-key.plugins.presets")
presets.operators['"_d'] = "Delete blackhole"
  1. Trying to somehow mimic the operator behavior in the source code
wk.register(
    {
        ["d"] = {[["_d]], "Delete blackhole"}
    },
    {prefix = "", preset = true}
)
  1. Setting it in the .setup() call
wk.setup({
  operators = {
      gc = "Comments",
      ['"_d'] = "Delete (blackhole)",
      -- ['d'] = "Delete (blackhole 2)" -- I tried both here
  },
})

I was not able to directly get d to trigger the operator popup window. I was able to get the key sequence that is being bound to d to show the popup window. That is, whenever I would press "_d manually, the popup window would appear and it would not copy it to my clipboard.

I'm unsure how to change this behavior.

lmburns avatar Apr 22 '22 00:04 lmburns