lsp-setup.nvim icon indicating copy to clipboard operation
lsp-setup.nvim copied to clipboard

Question: Add `desc` parameter to mappings

Open shahamran opened this issue 2 years ago • 2 comments

Hi, thanks for this plugin, it makes my init.lua much nicer.

I apologize in advance if this is a silly question, I'm new to neovim.

Inspired by kickstart.nvim, I set mappings like this:

vim.keymap.set('n', 'gd', vim.lsp.buf.definition, { buffer = bufnr, desc = '[G]o to [D]efinition' })

which made integration with which-key really nice.

Is there a way to achieve this simply with this plugin? Or should I just set default_mappings = false and configure it manually?

Thanks!

shahamran avatar Jun 29 '23 07:06 shahamran

I just looked at: lua/lsp-setup/utils.lua and it seems like opts are hardcoded.

I guess changing the config to support something like that is possible, but maybe you don't want to add this kind of complexity (after all, this plugin exists to reduce configuration complexity). If you'll be open to such change, let me know, and I can try to implement it :)

shahamran avatar Jun 29 '23 07:06 shahamran

@shahamran PRs are doubly welcome!

junnplus avatar Jun 29 '23 08:06 junnplus