Closed ColinKennedy closed 3 months ago
@ColinKennedy the docs indicate that you should disable operators before calling setup (refer to the comment in the example of this section).
I'd like to confirm what you're suggesting. If you mean "move the presets.operators["d"] = nil
before setup, that doesn't work. If you use the reproduction file and load the repro with nvim -u /path/to/repro.lua
and press d
, which-key will pop-up and show s ➜ <Plug>Dsurround
I tried a few configurations but none of them work
None of the above work. I've tried more configurations that this but I hope this gets addressed. If you have an modified configuration that works, it'd be great if you can post it for me and any others who are experiencing this. Thank you.
@ColinKennedy I think you've misunderstood what the setting does. presets.operators
will just disable the built-in Vim operators (and so as your picture clearly shows, which-key
isn't showing things like dd
, dw
, etc). It won't disable the d
motions coming from other plugins. In order to do that, you should use which_key_ignore
or set ignore_missing
.
It seems the best I can hope for with current functionality is ignore_missing
as which_key_ignore
doesn't prevent the pop-up from what I can tell. FWIW I knew that it was o-pending operators from other plug-ins that was why the pop-up was being shown, just not the setting needed to disable them. I was able to piece together using the bits you provided. It'd still be nice to be able to disable pop-ups for selective keys but this is good enough for me. Thanks.
@ColinKennedy glad I could help :)
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.
Did you check docs and existing issues?
Neovim version (nvim -v)
NVIM v0.9.0
Operating system/version
CentOS Linux release 7.9.2009 (Core)
Describe the bug
I'd like whichkey not to pop up when pressing the
d
key. For the most part this works however some other installed plug-ins, https://github.com/tpope/vim-surround and https://github.com/tommcdo/vim-ninja-feet for example, extendd
and other modes with o-pending operators and those completion results are still shown by which-key even though I've includedrequire("which-key.plugins.presets").operators["d"] = nil
on start-up.Here's part of my configuration (full reproduction at the bottom)
Click to expand
(Uses [lazy.nvim](https://github.com/folke/lazy.nvim)) ```lua -- Note: The full configuration truncated to only the relevant parts { "folke/which-key.nvim", event = "VeryLazy", config = function() local which_key = require("which-key") which_key.setup { triggers_blacklist = { c = {"%", ">"}, -- Prevent mappings like %s/ from popping up }, plugins = { presets = { motions = false, text_objects = false, operators = false, } } } local presets = require("which-key.plugins.presets") presets.operators["d"] = nil which_key.register( { ["Steps To Reproduce
d
keyYou should see output that looks like this:
Expected Behavior
No pop-up to show because
was included in the which-key.nvim configuration
Repro