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.76k stars 154 forks source link

feature: Add option to exclude + register contents from register display. #598

Closed ljtpetersen closed 1 month ago

ljtpetersen commented 2 months ago

Did you check the docs?

Is your feature request related to a problem? Please describe.

On Wayland, Neovim uses wl-copy and wl-paste. wl-paste hangs if the clipboard is empty. This isn't normally an issue, as I don't try to paste when there isn't anything in the clipboard. However, WhichKey will automatically show the contents of the clipboard when using or ". This causes Neovim to hang until something has been copied into the clipboard.

Describe the solution you'd like

An option to exclude the + register when displaying registers using or ". Perhaps, only exclude the contents of the + register.

Describe alternatives you've considered

Instead of creating an option specifically for the + register, a more general setting allowing one to exclude any registers could be more useful.

Additional context

I should be able to implement this myself, but I am not sure where in the configuration the option should go.

eyalk11 commented 2 months ago

Add a feature to set displays registers. I had to do commit to set it right!

nikfp commented 1 month ago

@ljtpetersen

I should be able to implement this myself, but I am not sure where in the configuration the option should go.

I worked through the sections of code that this would apply to for another PR, I can get this going if you want? Or if you'd rather do it I can point you to where to go. Let me know, I think there is value in this myself and I think (hope) @folke will agree.

ljtpetersen commented 1 month ago

@ljtpetersen

I should be able to implement this myself, but I am not sure where in the configuration the option should go.

I worked through the sections of code that this would apply to for another PR, I can get this going if you want? Or if you'd rather do it I can point you to where to go. Let me know, I think there is value in this myself and I think (hope) @folke will agree.

I've been pretty busy recently, so the first option works best for me. Thanks!

nikfp commented 1 month ago

Cool. I'll hack on this the next couple days when I have a few.

folke commented 1 month ago

No option needed. Just change the below to what you want.

require("which-key.plugins.registers").registers = '*+"-:.%/#=_abcdefghijklmnopqrstuvwxyz0123456789'