folke / which-key.nvim

💥 Create key bindings that stick. WhichKey is a lua plugin for Neovim 0.5 that displays a popup with possible keybindings of the command you started typing.
Apache License 2.0
4.73k stars 154 forks source link

bug: Missing default bindings - `dd` and `yy` not shown in screen for `d` and `y` keys #595

Closed b4shful closed 3 days ago

b4shful commented 2 months ago

Did you check docs and existing issues?

Neovim version (nvim -v)

NVIM v0.9.5

Operating system/version

Ubuntu 22.04

Describe the bug

The yy and dd default binds are not shown in the plugin.

I can reproduce it with the minimal init.lua given as a default in this template.

Steps To Reproduce

  1. Open a document
  2. Press y or d to open the WhichKey screen for these two keys.

Expected Behavior

When y pressed, one of the options should inform that if the next key is y then it will yank the current line (yy). Likewise when d is pressed, one of the options should inform that pressing d as the next key will delete the current line (dd).

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
github-actions[bot] commented 4 days ago

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.

b4shful commented 4 days ago

Bug still exists

folke commented 3 days ago

That;s not possible, since y and d trigger operator pending mode. Impossible to show which-key