:autocmdadds to the list of autocommands regardless of whether they are already present. When your .vimrc file is sourced twice, the autocommands will appear twice. To avoid this, define your autocommands in a group, so that you can easily clear them:
augroup vimrc autocmd! " Remove all vimrc autocommands au BufNewFile,BufRead *.html so <sfile>:h/html.vim augroup END
But when I put that in my .vimrc, I get an error when it's sourced:
E216: No such group or event: " Remove all vimrc autocommands
And it appears not to work. My autocommands run multiple times when I re-source .vimrc.
If I remove the comment, it seems fine. So is there a bug with
autocmd! trying to parse comments? Or did I miss something?