Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Kaiser-Yang opened this issue Apr 17, 2024 · 1 comment

Comments

@Kaiser-Yang
Copy link

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
Copy link
Author

Kaiser-Yang commented Apr 17, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant