A Neovim plugin for managing commit drafts and automated changelog generation using Conventional Commits.
- Interactive Commit Drafts: Add commits with interactive prompts following Conventional Commits format
- Automatic Versioning: Semantic versioning based on commit types (feat → minor, fix → patch, breaking → major)
- Changelog Generation: Automated CHANGELOG.md creation from commit drafts
- Git Integration: Direct Git commit execution using draft content
- Visual Editing: Open and edit commit draft file directly in Neovim
-- Add to your Neovim config
vim.opt.rtp:append("~/.config/nvim/path/to/commit-draw")
require("commit_draw").setup()use {
"wcervini/commit_draw",
config = function()
require("commit_draw").setup()
end
}return {
"wcervini/commit_draw",
config = function()
require("commit_draw").setup()
end
}Default configuration:
require("commit_draw").setup({
commit_draw_path = ".git/COMMIT_DRAFT", -- Path for commit draft file
changelog_path = "CHANGELOG.md", -- Path for changelog file
version_file = "VERSION", -- Path for version file
auto_clear = true, -- Auto-clear draft after applying
})-
Add commits to draft:
:CommitDrawAdd
Interactive prompts will guide you through:
- Commit type (feat, fix, chore, docs, style, refactor, perf, test, build, ci, revert)
- Optional scope
- Description
- Optional notes
-
Review draft:
:CommitDrawOpen
Opens the draft file for manual editing. Example draft content:
feat(api): add new authentication endpoint fix(auth): resolve token expiration issue ! chore: update dependencies -
Generate release:
:CommitDrawApply
This will:
- Parse the commit draft
- Calculate new semantic version
- Update CHANGELOG.md
- Update VERSION file
- Clear the draft (if auto_clear is true)
-
Commit to Git:
:CommitDrawCommit
Performs actual Git commit using the draft content.
" Add multiple commits to draft
:CommitDrawAdd
" Select: feat, api, "add user management endpoints"
:CommitDrawAdd
" Select: fix, auth, "fix login timeout issue"
" Review and edit draft
:CommitDrawOpen
" Generate release (creates CHANGELOG and updates VERSION)
:CommitDrawApply
" Commit changes to Git
:CommitDrawCommitThe plugin creates and manages these files:
.git/COMMIT_DRAFT: Contains commit entries in Conventional Commits formatCHANGELOG.md: Generated changelog with version historyVERSION: Current semantic version (e.g., "1.2.3")
| Command | Description |
|---|---|
CommitDrawAdd |
Interactive commit addition to draft |
CommitDrawApply |
Apply draft to generate release and changelog |
CommitDrawCommit |
Perform Git commit using draft content |
CommitDrawOpen |
Open commit draft file for editing |
Supported commit types:
feat: New feature (minor version bump)fix: Bug fix (patch version bump)chore: Maintenance tasksdocs: Documentation changesstyle: Code style changesrefactor: Code refactoringperf: Performance improvementstest: Test-related changesbuild: Build system changesci: CI/CD changesrevert: Revert previous commit
Breaking changes are indicated with ! after the type.
The plugin follows semantic versioning rules:
- Major: Breaking changes (commits with
!) - Minor: New features (
feattype commits) - Patch: Bug fixes (
fixtype commits)
## 1.2.3
- feat(api): add new authentication endpoint
- fix(auth): resolve token expiration issue
- chore: update dependencies1.2.3
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
MIT License - see LICENSE.md for details.