Skip to content

Instantly share code, notes, and snippets.

@rmccue
Created November 4, 2014 05:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rmccue/d04a65508b0027225cf0 to your computer and use it in GitHub Desktop.
Save rmccue/d04a65508b0027225cf0 to your computer and use it in GitHub Desktop.
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