Note
I use the local vim plugin, which allows me to use a specific project .vimrc file, in general it works fine and, as expected.
Background
I work with Silverstripe and therefore should work with Silverstripe templates, which are * .ss files, but by default vim assigns * .ss files to schema files. Now I use only Silverstripe for one project and use the html filetype installed in my project for the .vimrc widget for selection, however, after detecting several errors, I decided that I would add the selection for * .ss files to htmlss.vim (using html.vim in as a base, I just added template rules closer to the end). After several trial and error, I got it working and highlighting correctly, however, I ran into a strange error ...
Question
Using this .vimrc project:
augroup filetypedetect autocmd! * *.ss autocmd! BufEnter *.ss setf htmlss augroup END
Everything works fine, however, using this .vimrc:
augroup filetypedetect autocmd! * *.ss autocmd! BufEnter,BufRead,BufNewFile *.ss setf htmlss augroup END
Syntax highlighting fails, it sets the file type correctly, but highlighting becomes creepy.
I suppose I want to know why version 1 works, but version 2 does not work, no matter what changes.
adding
After a little research, I found that removing autocmd! * *.ss autocmd! * *.ss does a second job only if I delete ! from autocmd! BufEnter,BufRead,BufNewFile *.ss setf htmlss autocmd! BufEnter,BufRead,BufNewFile *.ss setf htmlss . i.e.
augroup filetypedetect autocmd BufEnter,BufRead,BufNewFile *.ss setf htmlss augroup END
works but
augroup filetypedetect autocmd! BufEnter,BufRead,BufNewFile *.ss setf htmlss augroup END
and
augroup filetypedetect autocmd! * *.ss autocmd BufEnter,BufRead,BufNewFile *.ss setf htmlss augroup END
not.
Again, my question is why these differences occur, I now have a working implementation, so I'm not interested in any kind of research. I do not want solutions because I have no problems.