kylechui / nvim-surround

Add/change/delete surrounding delimiter pairs with ease. Written with :heart: in Lua.
MIT License
2.98k stars 60 forks source link

Add description for default keymaps #187

Closed tummetott closed 1 year ago

tummetott commented 1 year ago

Hey there. First of all, great plugin!! I recently switched from tpopes vim-surround and I don't want to go back 👍

My question: It would be nice if the default keymaps have a description. Descriptions are usefull for showing a help window with e.g. 'which-key.nvim' or for debugging.

Also user defined keymaps within the setup function could benefit from a description. One possible example:

setup = {
    keymaps = {
        normal = { mapping = "ys", desc = "Surround textobject with pair" }
        normal_cur = { maping = "yss", desc = "Surround the current line with pair" }
        ...
    },
}
kylechui commented 1 year ago

Hi, are you using the tagged version of the plugin? Keymap descriptions should be active in the latest (untagged) commit.

tummetott commented 1 year ago

I'm loading the plugin without tag. But when pressing ys, my which-key popup shows

image

kylechui commented 1 year ago

Ah, it appears that I put the keymap descriptions on the internal binds by mistake; I'll fix it when I get the chance (or if anyone wants to make a PR that would be much appreciated)

kylechui commented 1 year ago

This should be fixed in the latest commit; if it isn't then feel free to re-open this issue!

tummetott commented 1 year ago

Awesome thank you ❤️

trevarj commented 6 months ago

It would still be neat to be able to add a custom description by changing the hardcoded ones. Is this not possible now?

PR with this change: https://github.com/kylechui/nvim-surround/pull/295