Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using OS X, but I don't think that matters.

By default, both MacVim and [terminal] Vim handle auto-indentation of HTML 4.0 elements, but any HTML5 elements, such as <header> and <footer>, don't trigger the auto-indentation. They're also not syntax-highlighted.

How can I add let Vim recognize HTML5 elements, or better yet, make Vim recognize any element instead of only pre-configured ones?

share|improve this question
up vote 2 down vote accepted

Without plugin, you can locate the html syntax file and add the html5 elements. But other people have already done the work for you, I think.

share|improve this answer
I wasn't able to find the existing syntax file, but the one you linked to worked well. Thank you! – Closure Cowboy Jun 21 '11 at 6:24
You are welcome. The default HTML syntax file can be found in /usr/share/vim. For MacVim it's located inside of the app bundle. – romainl Jun 21 '11 at 7:30

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.