Interestingly, both git and Mercurial simply use INI files. That is, it
seems wrong to have a special gitconfig filetype (and a special
hgrc/etc.). They should all just be ini files.
Today, this was released:
http://bitbucket.org/boredzo/vim-ini-syntax/
It's an INI syntax file for Vim, and there are instructions on
associating the file type with hgrc files. It could just as easily be
applied to gitconfig as well.
Sometime in the next Vim, it would be nice to see hgrc syntax support
(as an INI file or otherwise).
--Ted
--
Ted Pavlic <t...@tedpavlic.com>
autocmd BufNewFile,BufRead *.hgrc,*hgrc setfiletype cfg
--Ted
So does the already existing 'dosini' filetype. However, neither
'dosini' nor your 'ini' syntax file allow for comments at end of line,
ie
gitproxy=default-proxy ; for all the rest
gitconfig handles this, as well as checking that strings stored to
variables are properly terminated, and that recognized escape
characters are not highlighted within a string. All of these are
valuable things for a syntax file to do. 'cfg' or 'ini' or 'dosini'
aren't inappropriate, they just don't know as much about the format
git requires and can't highlight it as well because of that. Like
setting ft=c in a C++ file, most things will work but not everything.
~Matt
Okay. All good points.
So maybe "gitconfig" should be the filetype for hgrc files.