A minimal Vim configuration that enforces git commit message best practices.
- 50 character subject line - Automatically truncates the first line to 50 characters
- Blank second line - Enforces a blank line between subject and body
- 72 character body - Wrap text width to 72 with a visual column guide at 73
- Spell checking - Enables English spell checking for commit messages
git config --global core.editor "vim"If you don't have a ~/.vimrc file yet, follow these instructions. This will create a new Vim configuration file for you.
curl -fsSL https://raw.githubusercontent.com/jezsung/gitcommit-vimrc/main/.vimrc -o ~/.vimrcIf you already have a ~/.vimrc file with your own customizations, follow these instructions. This will add the git commit settings to your existing configuration without overwriting it.
Download this Vim configuration:
curl -fsSL https://raw.githubusercontent.com/jezsung/gitcommit-vimrc/main/.vimrc -o ~/.gitcommit.vimThen add the source line to your existing ~/.vimrc:
echo 'source ~/.gitcommit.vim' >> ~/.vimrcRun git commit in your terminal. Vim will automatically detect the commit message file and apply this configuration. You'll immediately benefit from:
- Subject line truncation at 50 characters
- Automatic blank second line enforcement
- Text wrapping at 72 characters with a visual guide
- Spell checking for your commit messages
No additional commands or setup required.
