AI-powered coding partner for Neovim with LLM integration. Features: - Split view for coder files (*.coder.*) and target files - Tag-based prompts with /@ and @/ syntax - Claude API and Ollama (local) LLM support - Smart prompt detection (refactor, add, document, explain) - Automatic code injection into target files - Project tree logging (.coder/tree.log) - Auto .gitignore management Ask Panel (chat interface): - Fixed at 1/4 screen width - File attachment with @ key - Ctrl+n for new chat - Ctrl+Enter to submit - Proper window close behavior - Navigation with Ctrl+h/j/k/l Commands: Coder, CoderOpen, CoderClose, CoderToggle, CoderProcess, CoderAsk, CoderTree, CoderTreeView
5.2 KiB
5.2 KiB
Contributing to Codetyper.nvim
First off, thank you for considering contributing to Codetyper.nvim! 🎉
Table of Contents
- Code of Conduct
- Getting Started
- Development Setup
- Project Structure
- Making Changes
- Submitting Changes
- Style Guide
- Testing
- Questions
Code of Conduct
This project and everyone participating in it is governed by our commitment to creating a welcoming and inclusive environment. Please be respectful and constructive in all interactions.
Getting Started
- Fork the repository
- Clone your fork locally
- Set up the development environment
- Create a branch for your changes
- Make your changes
- Submit a pull request
Development Setup
Prerequisites
- Neovim >= 0.8.0
- Lua 5.1+ or LuaJIT
- Git
Local Development
-
Clone the repository:
git clone https://github.com/YOUR_USERNAME/codetyper.nvim.git cd codetyper.nvim -
Create a minimal test configuration:
-- test/minimal_init.lua vim.opt.runtimepath:append(".") require("codetyper").setup({ llm = { provider = "ollama", -- Use local for testing }, }) -
Test your changes:
nvim --clean -u test/minimal_init.lua
Project Structure
codetyper.nvim/
├── lua/
│ └── codetyper/
│ ├── init.lua # Main entry point
│ ├── config.lua # Configuration management
│ ├── types.lua # Type definitions
│ ├── utils.lua # Utility functions
│ ├── commands.lua # Command definitions
│ ├── window.lua # Window/split management
│ ├── parser.lua # Prompt tag parser
│ ├── gitignore.lua # .gitignore management
│ ├── autocmds.lua # Autocommands
│ ├── inject.lua # Code injection
│ ├── health.lua # Health check
│ └── llm/
│ ├── init.lua # LLM interface
│ ├── claude.lua # Claude API client
│ └── ollama.lua # Ollama API client
├── plugin/
│ └── codetyper.lua # Plugin loader
├── doc/
│ └── codetyper.txt # Vim help documentation
├── README.md
├── LICENSE
├── CHANGELOG.md
├── CONTRIBUTING.md
└── llms.txt
Making Changes
Branch Naming
Use descriptive branch names:
feature/description- New featuresfix/description- Bug fixesdocs/description- Documentation updatesrefactor/description- Code refactoring
Commit Messages
Follow conventional commits:
type(scope): description
[optional body]
[optional footer]
Types:
feat- New featurefix- Bug fixdocs- Documentationstyle- Formatting, no code changerefactor- Code restructuringtest- Adding testschore- Maintenance
Examples:
feat(llm): add support for GPT-4 API
fix(parser): handle nested prompt tags
docs(readme): update installation instructions
Submitting Changes
- Ensure your code follows the style guide
- Update documentation if needed
- Update CHANGELOG.md for notable changes
- Test your changes thoroughly
- Create a pull request with:
- Clear title describing the change
- Description of what and why
- Reference to any related issues
Pull Request Template
## Description
[Describe your changes]
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Documentation update
- [ ] Refactoring
## Testing
[Describe how you tested your changes]
## Checklist
- [ ] Code follows style guide
- [ ] Documentation updated
- [ ] CHANGELOG.md updated
- [ ] All tests pass
Style Guide
Lua Style
- Use 2 spaces for indentation
- Use
snake_casefor variables and functions - Use
PascalCasefor module names - Add type annotations with
---@param,---@return, etc. - Document public functions with LuaDoc comments
---@mod module_name Module description
local M = {}
--- Description of the function
---@param name string The parameter description
---@return boolean Success status
function M.example_function(name)
-- Implementation
return true
end
return M
Documentation
- Keep README.md up to date
- Update doc/codetyper.txt for new features
- Use clear, concise language
- Include examples where helpful
Testing
Manual Testing
- Test all commands work correctly
- Test with different file types
- Test window management
- Test LLM integration (both Claude and Ollama)
- Test edge cases (empty files, large files, etc.)
Health Check
Run :checkhealth codetyper to verify the plugin setup.
Questions?
Feel free to:
- Open an issue for bugs or feature requests
- Start a discussion for questions
- Reach out to the maintainer
Contact
- Maintainer: cargdev
- Email: carlos.gutierrez@carg.dev
- Website: cargdev.io
- Blog: blog.cargdev.io
Thank you for contributing! 🙏