Thank you for your interest in contributing to occurrence.nvim! This document provides guidelines for contributing to the project.
- Search existing issues before creating a new one
- Provide clear reproduction steps
- Include Neovim version and plugin configuration
- Share minimal test cases when possible
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature-name - Make your changes following the guidelines below
- Write or update tests as needed
- Ensure all tests pass:
make test(see Testing section) - Update documentation if needed
- Submit a pull request
This project uses Conventional Commits for automated changelog generation.
1. Install git hooks for local validation:
make install-hooksThis installs a commit-msg hook that validates your commit messages locally before they're committed.
2. Set up the commit message template (optional but recommended):
git config commit.template .gitmessageNow when you run git commit (without -m), your editor will open with the template pre-filled with examples and guidelines.
<type>(<scope>): <subject>
<body>
<footer>
Must be one of:
- feat: A new feature
- fix: A bug fix
- docs: Documentation only changes
- style: Code style changes (formatting, missing semicolons, etc.)
- refactor: Code changes that neither fix bugs nor add features
- perf: Performance improvements
- test: Adding or updating tests
- build: Changes to build system or dependencies
- ci: Changes to CI configuration files and scripts
- chore: Other changes that don't modify src or test files
- revert: Reverts a previous commit
Optional. Can be anything specifying the place of the commit change:
api- API changesconfig- Configuration changesoperators- Operator-related changesactions- Action-related changeskeymap- Keymap changesextmarks- Extmark/highlighting changestests- Test-related changesdocs- Documentation changes
- Use imperative, present tense: "change" not "changed" nor "changes"
- Don't capitalize the first letter
- No period (.) at the end
- Limit to 72 characters
Optional. Provide additional context about the change:
- Explain the motivation for the change
- Contrast this with previous behavior
- Use imperative, present tense
Optional. Reference issues and include breaking changes:
- Reference issues:
Fixes #123,Closes #456 - Breaking changes: Start with
BREAKING CHANGE:followed by description
- Follow existing code patterns and conventions
- Format code with stylua
- Add LuaCATS type annotations for public APIs
Setup local luarocks environment and run tests:
# Run all tests (will install dependencies if needed)
make test
# Run performance tests only
make test-perf- Write tests for new features using busted
- Ensure existing tests pass:
make test - Add performance tests for performance-critical features
- Run tests in isolation:
make test tests/path/to/test_spec.lua
- Update README.md for user-facing changes
- Add/update LuaCATS annotations for API changes
- Regenerate vim help:
make doc - Document breaking changes clearly
- Add examples for new features
lua/occurrence.lua- Main plugin entry pointlua/occurrence/- Core plugin modulesOccurrence.lua- Central occurrence managementConfig.lua- Configuration handlingapi.lua- Built-in actionsoperators.lua- Built-in operatorsOperator.lua- Operator executionExtmarks.lua- Visual highlightingKeymap.lua- Keymap managementRange.lua,Location.lua,Cursor.lua- Position utilities
plugin/occurrence.lua- Lazy loading plugin entrytests/- Test suite including performance testsoccurrence/- Unit tests for core modulesperf_spec.lua- Performance benchmarksdot_repeat_spec.lua- Dot-repeat integration testsintegration_spec.lua- Integration testsplugin_spec.lua- Plugin-level tests
.github/workflows/- CI/CD automationdoc/- Auto-generated vim help (via panvimdoc)git-hooks/- Git hooks for commit validationCHANGELOG.md- Auto-generated changelogCONTRIBUTING.md- Contribution guidelines (this file)README.md- Project overview and documentation
Releases are fully automated using Release Please:
- Commit to main: Push commits following Conventional Commits to the
mainbranch - Automatic PR Creation: Release Please automatically:
- Analyzes commits since last release
- Determines next version based on commit types (feat = minor, fix = patch, breaking = major)
- Generates/updates CHANGELOG.md
- Creates a "Release PR" with all changes
- Review and Merge: Review the Release PR and merge when ready
- Automatic Release: On merge, Release Please:
- Creates a GitHub release with the changelog
- Tags the release (e.g.,
v1.2.3) - Triggers the release workflow (tests + publish)
Release Please uses commit types to determine version bumps:
feat:→ Minor version bump (0.1.0 → 0.2.0)fix:,perf:→ Patch version bump (0.1.0 → 0.1.1)feat!:,fix!:, orBREAKING CHANGE:→ Major version bump (1.0.0 → 2.0.0)docs:,style:,refactor:,test:,chore:→ No version bump (included in next release)
- Check existing documentation in README.md or
:h occurrence - Search closed issues for similar questions
- Open a new issue with your question
- Join discussions in GitHub Discussions (if enabled)
By contributing to occurrence.nvim, you agree that your contributions will be licensed under the MIT License.