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.99k stars 160 forks source link

bug: Some default mappings for folds (z,],[) and 'g' are missing #533

Closed uri closed 9 months ago

uri commented 9 months ago

Did you check docs and existing issues?

Neovim version (nvim -v)

v0.9.4

Operating system/version

MacOS 14.0

Describe the bug

Pressing z does not show j or k options.

Pressing g does not show j or k options.

Pressing ] or [ does not show z.

Steps To Reproduce

  1. Press z - missing j k
  2. Press g - missing j k
  3. Press ] - missing z
  4. fpress [ - missing z

Expected Behavior

Show the mappings.

Repro

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  "folke/tokyonight.nvim",
  { "folke/which-key.nvim", config = true },
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here
folke commented 9 months ago

There's a billion mappings missing. The point of the which-key presets is not to be exhaustive, but to contain the most widely used mappings. You can always add additional mappings yourself

uri commented 9 months ago

Is there a way to add all the mappings like a verbose option? I'm sure some people use this plugin as a discovery tool and if they're never presented with certain mappings, could lead to some bad habits.

folke commented 9 months ago

Sorry no. There's really lots and lots of missing mappings. Check out this PR (that I won't merge) if you want to add more: https://github.com/folke/which-key.nvim/pull/120