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

Pop-up doesn't appear when pressing <leader>

Open kahnclusions opened this issue 3 years ago • 5 comments

As the title says. It could be an incompatibility with a recent change in neovim nightly, because it works fine in 0.7.2, but broken in nightly.

When pressing <leader> I get the usual text in the command bar <bs> go up one level <esc> close, but no window with the root keybindings. If I then press another key, I will get the which-key pop-up as usual for that submenu.

kahnclusions avatar Jul 14 '22 20:07 kahnclusions

I have the same issue on Neovim nightly (NVIM v0.8.0-dev-).

Like you said, whichkey only shows the "help" information if enabled <bs> go up one level <esc> close and also the key you pressed, <leader> for me.

rainstf avatar Jul 22 '22 18:07 rainstf

same issue on NVIM v0.8.0-dev-

huwqchn avatar Aug 12 '22 23:08 huwqchn

I am having this problem on 0.7.2 official. One WhichKey is run from inside the editor everything works fine, but I can't run WhichKey inside my config anywhere.

Rogersiver avatar Aug 13 '22 20:08 Rogersiver

Same problem here.. writing it manually shows the popup correctly but it doesn't do it automatically. For now, I use: map("n", "<Leader>", ":WhichKey\r<leader>", opts)

not perfect but it works.

leoenix avatar Aug 15 '22 19:08 leoenix

set nvim timeout = true and set timeoutlen will fix popup problem, it works for me

huwqchn avatar Aug 28 '22 13:08 huwqchn

I am also facing this issue with nvim 0.8.0

kskarthik avatar Dec 14 '22 19:12 kskarthik

did you check with :checkhealth which_key?

folke avatar Dec 14 '22 20:12 folke

@folke these are the only warning i get

image

kskarthik avatar Dec 15 '22 04:12 kskarthik

this config works

	use {
		"folke/which-key.nvim",
		config = function()
			vim.cmd([[
			set timeout
			set timeoutlen
			]])
			require("which-key").setup()
		end
	}

kskarthik avatar Dec 22 '22 19:12 kskarthik

~I don't know why, but my opts included prefix = "<leader>". Removing that line fixed it for me, so now pressing the leader alone pops up the available mappings.~ EDIT: Hmm, but it's breaking other things, so maybe this isn't the solution... EDIT2: Maybe you can learn from my stupidity: I had a "blank" mapping, like mappings[""] = "Highlight Capture", which would mean it gets triggered with just the leader.

Doing checkhealth which_key did show this:

6 ▏ - WARNING: conflicting keymap exists for mode **"n"**, lhs: **"<leader>"**

So I should've paid attention to that, or known to interpret it properly. Removing that mapping (it was a typo to begin with) made it work again.

ckoehler avatar Jan 16 '23 22:01 ckoehler

@ckoehler the new example has the fix for this issue!

-- Lua
use {
  "folke/which-key.nvim",
  config = function()
    vim.o.timeout = true
    vim.o.timeoutlen = 300
    require("which-key").setup {
      -- your configuration comes here
      -- or leave it empty to use the default settings
      -- refer to the configuration section below
    }
  end
}

kskarthik avatar Jan 17 '23 06:01 kskarthik