liuchengxu / vim-which-key

:tulip: Vim plugin that shows keybindings in popup
https://liuchengxu.github.io/vim-which-key/
MIT License
1.93k stars 65 forks source link

Using [count] started commands for which-key to run the commands [count] times. #252

Open Kaiser-Yang opened 7 months ago

Kaiser-Yang commented 7 months ago

This is my config for which key:

set timeoutlen=500
let g:mapleader = "\<Space>"
let g:maplocalleader = ','
nnoremap <silent> <leader> :<c-u>WhichKey '<Space>'<CR>
vnoremap <silent> <leader> :<c-u>WhichKey '<Space>'<CR>

and I have a default bind of NerdCommenter, which looks like this:

[count]<leader>cc |NERDCommenterComment|

This bind will enable me execute <leader>cc for more than one time if I input a number first.

But when I input a number and space (my leader in vim), which key pops out (I'm thinking what I should type next) , and if I continue to input cc, this will only execute once.

So I hope when I input a number and space if the which key pops out after which I input cc, this will be execute exactly the number I input times.

Is there any method can enable this or any future considerations?

Kaiser-Yang commented 7 months ago

There is another issue: when in visual mode I selected some text, and press space once the WhichKey pops out, I lose all I've selected, the command executed later will only on where the cursor is.