Thank you for your interest in contributing to Claude-Code.nvim! This document provides guidelines and instructions to help you contribute effectively.
By participating in this project, you agree to maintain a respectful and inclusive environment for everyone.
There are several ways you can contribute to Claude-Code.nvim:
- Reporting bugs
- Suggesting enhancements
- Submitting pull requests
- Improving documentation
- Sharing your experience using the plugin
Before submitting an issue, please:
- Check if the issue already exists in the issues section
- Use the issue template if available
- Include as much relevant information as possible:
- Neovim version
- Claude Code CLI version
- Operating system
- Steps to reproduce the issue
- Expected vs. actual behavior
- Any error messages or logs
- Fork the repository
- Create a new branch for your changes
- Make your changes, following the coding standards below
- Test your changes thoroughly
- Submit a pull request with a clear description of the changes
For significant changes, please open an issue first to discuss your proposed changes.
For detailed instructions on setting up a development environment, required tools, and testing procedures, please refer to the DEVELOPMENT.md file. This comprehensive guide includes:
- Installation instructions for all required development tools on various platforms
- Detailed explanation of the project structure
- Testing processes and guidelines
- Troubleshooting common issues
To set up a development environment:
- Read the DEVELOPMENT.md guide to ensure you have all necessary tools installed
- Clone your fork of the repository
git clone https://github.com/greggh/claude-code.nvim.git-
Link the repository to your Neovim plugins directory or use your plugin manager's development mode
-
Make sure you have the Claude Code CLI tool installed and properly configured
-
Set up the Git hooks for automatic code formatting:
./scripts/setup-hooks.shThis will set up pre-commit hooks to automatically format Lua code using StyLua before each commit.
The DEVELOPMENT.md file contains detailed information about:
- StyLua - For automatic code formatting
- LuaCheck - For static analysis (linting)
- LDoc - For documentation generation (optional)
- Other tools and their installation instructions for different platforms
- Follow the existing code style and structure
- Use meaningful variable and function names
- Write clear comments for complex logic
- Keep functions focused and modular
- Add appropriate documentation for new features
We use StyLua to enforce consistent formatting of the codebase. The formatting is done automatically via pre-commit hooks if you've set them up using the script provided.
Key style guidelines:
- Configuration is in
stylua.tomlat the project root - Maximum line length is 120 characters
- Use 2 spaces for indentation
- Use local variables when possible
- Group related functions together
- Follow existing naming conventions:
snake_casefor variables and functionsPascalCasefor classes and constructors
Files are linted using LuaCheck according to .luacheckrc.
Before submitting your changes, please test them thoroughly:
You can run the test suite using the Makefile:
# Run all tests
make test
# Run specific test groups
make test-basic # Run basic functionality tests
make test-config # Run configuration tests
make test-plenary # Run plenary testsSee test/README.md and tests/README.md for more details on the different test types.
- Test in different environments (Linux, macOS, Windows if possible)
- Test with different configurations
- Test the integration with the Claude Code CLI
- Use the minimal test configuration (
tests/minimal-init.lua) to verify your changes in isolation
When adding new features, please update the documentation:
- Update README.md with any new features, configurations, or dependencies
- Update the Neovim help documentation in doc/claude-code.txt
- Include examples of how to use the new features
By contributing to Claude-Code.nvim, you agree that your contributions will be licensed under the project's MIT license.
If you have any questions about contributing, please open an issue with your question.
Thank you for contributing to Claude-Code.nvim!