Emerging protobuf with USE="vim-syntax" installs a vim syntax file, but it does not use that syntax for *.proto files. Per the recommendation in the proto.vim file, you probably want to create a file called /usr/share/vim/vimfiles/ftdetect/proto.vim with contents like: augroup filetype au! BufRead,BufNewFile *.proto setfiletype proto augroup end Reproducible: Always Steps to Reproduce: Open a *.proto file with vim. Actual Results: No syntax highlighting. Expected Results: Syntax highlighting.
Thanks, fixed in 2.3.0-r2.
The (now included) ftdetect file given (using the augroup command) actually effectively breaks the very popular "pathogen" plugin in a way that is not immediately obvious (which ends up making perl and bash files get the "conf" format applied to them). To reproduce, put vim-syntax on protobuf as described, then place the following lines in your ~/.vimrc: filetype off filetype on Now go open a shell script or perl file (really anything with a shebang that the default fallback will recognize as a conf file), and your syntax highlight will be incorrect. I see two possible "fixes", with the upstream one obviously being preferred, since ftdetect files should be allowed to use augroup, but with a very simple one possible here at the Gentoo level. For a little more explanation, the ftdetect files are sourced from filetype.vim (at /usr/share/vim/vim73/filetype.vim on my system), on line 2480. This is already following an augroup filetypedetect. Normally, that wouldn't be an issue, except that they then follow this up with another declaration that makes a fallback assignment to the "conf" format for files that include a comment as their first line (like a shebang), and since it theoretically follows after all the filetype detection plugins, it is used as the fallback. The problem comes when we "filetype off" (usually to load pathogen for handy ~/.vim/bundle support to keep ~/.vim nice and clean), since that sources ftoff.vim (same directory as filetype.vim), which simply deletes the filetypedetect group. Since ftdetect/proto.vim went and included augroup end, the fallback rule was placed in the default group instead of properly in the filetypedetect group, and doesn't get removed, so later matches with a higher precedence than it should (after "filetype on" reenables detection). It's taken me several hours to track down this proto.vim as the cause of the problem (finally had enough time to do so today), but the easiest solution is to simply remove the two augroup lines. I'll be happy to open a new ticket if necessary/preferred, just let me know. I just figured since the fix of this ticket really caused the bug that this would be an appropriate place to start. The easy fix for upstream is to follow that ftdetect sourcing with "augroup filetypedetect", so that the fallback gets added to the proper augroup, but technically, that would/should have to be run after _each_ ftdetect file is sourced (which I'm not sure VIM even has an easy way to accomplish), so that any file which changes the augroup doesn't break all the files that follow it. The best solution for them is to just forbid the use of augroup inside ftdetect files, and to document that properly. Just let me know if you'd like me to open a new ticket and I'll do so.