marks.nvim
marks.nvim copied to clipboard
keymap: use nvim api for setting keymaps
This allows setting a reasonable description for each mapping that will render nicely in plugins like which-key.
This is using the older vim.api.nvim_set_keymap
function in order to retain compatibility with Neovim 0.5, as noted in the readme. If/when the minimum version were bumped to 0.7, this could be further simplified to:
vim.keymap.set("n", key, M[cmd], { desc = "marks: "..cmd:gsub("_", " ") })
I think this patch makes sense to me. I don’t really see this plugin upgrading to vim.keymap
unless there’s a specific feature that it unlocks; I prefer to keep the plugin compatible with very old versions since its already pretty mature.
yeah, I definitely don't think there is any reason to use vim.keymap
here. And just to show the description change in which-key that I forgot in the original message...
before:
after: