junnplus / lsp-setup.nvim

A simple wrapper for nvim-lspconfig and mason-lspconfig to easily setup LSP servers.
Apache License 2.0
225 stars 12 forks source link

Question: Add `desc` parameter to mappings #51

Open shahamran opened 1 year ago

shahamran commented 1 year ago

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 commented 1 year ago

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 :)

junnplus commented 1 year ago

@shahamran PRs are doubly welcome!