kxps6g
Last Updated: February 25, 2016
·
698
· oz123
23e8d9c545b0a9d603765abaadc3f499

Never get caught with badly spelled git commit message

If you use VIM, and you are not a native English speaker - or worse: you are an English speaker - having commit messages with badly spelled words, is just embaressing.
Ofcourse you can use spell mode always, but sometimes having all those highlighted words when reading your own code is distracting. Hence, you end up, coding with spell mode shutdown.
But do you really want to turn spell manually every time you write a commit message? You like sparing your time right? So, here is a small addition to your vimrc:

" force spell when doing a git commit 
if  bufname("%")=="COMMIT_EDITMSG"
    set spell 
    set spelllang=en 
endif

That's it, you will never commit a message again with badly spelled words!

Say Thanks
Respond

2 Responses
Add your response

13068
2cd01b78a3a98b9a3d0ae41b20404182

i'd rather go with autocmd :

autocmd FileType gitcommit setlocal spell
autocmd FileType gitcommit setlocal spelllang=en
over 1 year ago ·
13071
23e8d9c545b0a9d603765abaadc3f499

SWEET!

over 1 year ago ·
Filed Under