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!
Written by Oz
Related protips
2 Responses
i'd rather go with autocmd :
autocmd FileType gitcommit setlocal spell
autocmd FileType gitcommit setlocal spelllang=en
over 1 year ago
·
SWEET!
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Vim
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#