mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-12-21 12:13:54 +01:00
2.4 KiB
2.4 KiB
Contributing to LazyVim
General Guidelines
- Avoid using Vim plugins whenever possible.
- If an extra requires a Vim plugin, explain why in the PR description.
- Ensure all configurations are overridable by the user, using Lazy's specs.
- Tag specs as
optionalif they should only be enabled when the user has them installed. - Implement proper lazy-loading for every plugin added in an extra.
- Understand how Lazy's dependencies work. For Lua dependencies, do not specify
them in the
dependenciesfield. Instead, add them as a separate spec withlazy=true.
Contributing an Extra Plugin
- The plugin should be well-known and require significant configuration.
- Simple specs containing just the plugin with some options will not be accepted.
Contributing an Extra Language
- You should be familiar with the language you are adding.
- You should have experience with the language's ecosystem, including formatters, linters, and LSP servers.
- The extra should include the setup most widely used by the community.
- Include Tree-sitter parsers that are not yet the default.
- Include the most widely used LSP server setup.
- Avoid the need for LSP wrapper packages whenever possible.
- Only add a formatter if it is typically used by the community instead of the LSP formatter.
- Only add extra linters if the community typically uses them instead of just the LSP linters.
- Every language extra requires a
recommendedsection as part of the extra. Check lspconfig server configurations for the proper filetypes and root directories. Refer to other extras for creating therecommendedsection.
Language-Specific Keymaps
- Use
<localleader>for language-specific keymaps (follows Vim/Neovim convention for filetype-specific mappings). - For LSP servers, define keymaps in the server's
keysfield, not inon_attach:servers = { rust_analyzer = { keys = { { "<localleader>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
Kfor hover,gdfor definition) unless absolutely necessary. - Use standard
<leader>c*keymaps where they make sense (e.g.,<leader>cofor organize imports). - Refer to the R and Haskell extras for examples of proper
<localleader>usage.