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
5.38k stars 177 forks source link

Missing keys? #446

Closed textzenith closed 1 year ago

textzenith commented 1 year ago

Did you check docs and existing issues?

Neovim version (nvim -v)

0.9

Operating system/version

Ubuntu

Describe the bug

Hi, I've been loving using which-key, but as I learn more about Vim / Neovim it's come to my attention that a lot of lesser known / used shortcuts are missing from the pop-ups — I'm talking about keys native to Vim, as well (all my plugin keys are showing as expected!)

One example lately is that I couldn't remember what the key bindings are to go back / forward through the changelist. I knew it was g-something, so I typed g, but the mappings I was looking for weren't there. This caused me to waste a lot of time searching through other key prefixes before I realized that which-key.nvim simply doesn't show them under g.

It's such a cool and useful pair of mappings, I can't figure out why they aren't listed.

Moreover, most g-prefixed commands actually aren't there.

As I want to use which-key.nvim to remember / discover obscure and lesser-used keymaps, it sabotages a large part of the expected functionality of the plugin, and causes me to think there aren't as many awesome keybindings in Neovim as there actually are.

I've searched the docs and can't find any mention of this 'feature', nor how to fix it. If you have a plugin to teach keymaps, and you are under-selling the true number of keymaps, this is something that should be mentioned prominently in the README, near the very top!

OK, sorry if I sound dramatic, I'm really enjoying using which-key and looking forward to any help or feedback on getting ALL built-in keybindings to appear. Thanks! 😺

Steps To Reproduce

Press g

Expected Behavior

See ; and , bindings

Repro

No response

TobinPalmerAlt commented 1 year ago

the g key works fine with my config.

image
return {
  'folke/which-key.nvim',
  event = 'BufReadPre',
  config = function()
    -- disable hints for certain operators
    local presets = require 'which-key.plugins.presets'
    presets.operators['v'] = nil
    presets.operators['c'] = nil
    presets.operators['d'] = nil
    presets.operators['y'] = nil

    local wk = require 'which-key'

    wk.setup {}
    wk.register({
      b = { name = 'Buffer' },
      f = { name = 'Telescope' },
      g = { name = 'LSP Actions' },
      t = { name = 'Trouble' },
    }, { prefix = '<leader>' })
  end,
}
d1agnozzz commented 1 year ago

I can confirm, there are no g; and g, keybindings in WhichKey table изображение

Moreover, I noticed some other vanilla vim keybindings are missing, such as

As a side note, i noticed some quirks with WhichKey displayed keymaps:

My config:

{
    "folke/which-key.nvim",
    event = "BufReadPre",
    init = function()
        vim.o.timeout = true
        vim.o.timeoutlen = 300
    end,
    config = function ()
        local wk = require 'which-key'

        wk.setup {}
        wk.register({
            f = { name = 'Telescope' },
            t = { name = 'Trouble' },
            v = {
                name = 'Git',
                v = 'LazyGit',
                f = 'Fugitive',
            },

        }, { prefix = '<leader>' })

    end
}
folke commented 1 year ago

The which-key presets don't include ALL the mappins, since that would make which-key kinda useless.

If you want more standard mappings, you can always add them in yourself.

varac commented 10 months ago

I also would like to add some missing key bindings to the popup (i.e. gw to auto-wrap keys). How would I do that (sorry, I read the README but still can't figure out the right way to achieve this).

Flimm commented 4 months ago

The which-key presets don't include ALL the mappins, since that would make which-key kinda useless.

I don't understand, why would that make which-key useless? Wouldn't it make which-key more useful?