created March 31, 2006 · complexity basic · author Anon · version 6.0
Just use the "htmlm4.vim" syntax script. (I got this from VimTip1041, but it was non-obvious to somebody looking for a quick answer.)
Put simply, while in normal mode, type the following:
You can automatically load this syntax for all html files by adding the following line to your vimrc
au BufRead *.html set filetype=htmlm4
- Thanks, but please spell out what you think we on the wiki should do (assuming I don't want to take the time to figure it all out). Are you saying:
- You automatically get that functionality (assuming say Vim 7) if filetype is html.
- So there is nothing in this tip that is worth keeping.
- We should delete this tip.
- JohnBeckett 10:10, 18 June 2009 (UTC)
Try it for your self, at least in my w3 compliant html file with embed js, syntax/html doesn't give the correct highlighting but syntax/htmlm4 does. For that reason alone I think this page should stay. A counter intuative and suprising work around, but if it works, it works.