Skip to content

Instantly share code, notes, and snippets.

Created Nov 4, 2014
What would you like to do?
Commit message syntax highlighting in Vim with submodules

Ever tried committing inside a git submodule, only to find that Vim doesn't syntax highlight your commit message? Worry no more!

Simply save the following file as ~/.vim/filetype.vim

autocmd BufNewFile,BufRead *.git/modules/**/COMMIT_EDITMSG setf gitcommit
autocmd BufNewFile,BufRead *.git/modules/**/config setf gitconfig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment