Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable spellcheck in vim on git-commit

Tags:

git

vim

I am trying to enable the spell in Vim in case of editing the git commit message. The filename is fixed, so autocmd won't help. I've put a modeline in the initial message, but the ftpplugin/gitcommit.vim disables the modeline.

What is the way to have custom vim settings for git-commit case?

like image 797
IvanDi Avatar asked Sep 15 '25 15:09

IvanDi


1 Answers

git commit msg has filetype gitcommit. You can add autocmd on that filetype, for example:

autocmd FileType gitcommit setlocal spell

All commit message in your vim should have spell check activated.

like image 155
Kent Avatar answered Sep 18 '25 05:09

Kent