A lightweight popup for writing Git commit messages directly within Neovim.
It facilitates a descriptive commit style (e.g. Mitchell Hashimoto) by providing a dedicated writing environment.
Note: CommitPad assumes you have staged your changes (
git add) before running. It also does not manage existing commits.
- Markdown Buffer: The input is a
filetype=markdownbuffer, enabling your formatters, linters, snippets, and LSP. - Persistent & Isolated Drafts: Stored in
.git/commitpad/draft.md.- No
.gitmessageclutter or.gitignorepollution. - Drafts are isolated per worktree and persist across sessions.
- No
- Visual Validation:
- Real-time highlighting of title length to assist with 50/72 rule.
- Flags non-conventional commit types (e.g.,
doc:vsdocs:) and structural breaks in thetype[scope][!]: descriptionformat.
- Vs
fugitive: Preserves your window layout by using a floating overlay instead of disruptive splits. - Vs
$EDITOR: Instantly summon and dismiss your draft with a dedicated toggle (<leader>gc). - Vs
lazygit: Leverages your full Neovim setup (LSP, spell check), avoiding the overhead of a TUI context switch. - Vs
git commit -m: Enables iterative drafting and multiline formatting, rather than hasty one-liners.
Lazy.nvim
{
"Sengoku11/commitpad.nvim",
dependencies = { "MunifTanjim/nui.nvim" },
cmd = { "CommitPad" },
keys = {
{ "<leader>gc", "<cmd>CommitPad<cr>", desc = "CommitPad" },
{ "<leader>gac", "<cmd>CommitPadAmend<cr>", desc = "CommitPadAmend" },
},
opts = {
-- Defaults
footer = false, -- A dedicated buffer that provides a "sticky" area for repetitive tags
stage_files = true, -- Display staged files in UI
},
}- Neovim 0.10+ (uses
vim.system) MunifTanjim/nui.nvim
For the best experience writing prose in the popup, these settings are recommended.
-- Soft wrap lines at word boundaries, preserving indentation
vim.opt.wrap = true -- Enable soft wrap (required for the options below)
vim.opt.breakindent = true -- Visual indentation matches the code level
vim.opt.linebreak = true -- Wrap at words, not arbitrary characters
-- Builtin spell check
vim.opt.spell = true
vim.opt.spelllang = { "en_us" }
vim.opt.spelloptions = "camel"- Grammar: Harper-ls
- Rendering: MeanderingProgrammer/render-markdown.nvim
