diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d08a3622..cf3e1616 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -29,3 +29,21 @@ - Every language extra requires a `recommended` section as part of the extra. Check lspconfig server configurations for the proper filetypes and root directories. Refer to other extras for creating the `recommended` section. + +### Language-Specific Keymaps + +- Use `` for language-specific keymaps (follows Vim/Neovim convention for filetype-specific mappings). +- For LSP servers, define keymaps in the server's `keys` field, not in `on_attach`: + ```lua + servers = { + rust_analyzer = { + keys = { + { "e", function() vim.cmd.RustLsp("expandMacro") end, desc = "Expand Macro" }, + } + } + } + ``` +- LazyVim's LSP system will automatically resolve and apply these keymaps (see `lua/lazyvim/plugins/lsp/keymaps.lua`). +- Don't override standard LSP keymaps (like `K` for hover, `gd` for definition) unless absolutely necessary. +- Use standard `c*` keymaps where they make sense (e.g., `co` for organize imports). +- Refer to the R and Haskell extras for examples of proper `` usage.