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 having trouble editing HTML in an older version of VI(M). VIM - Vi IMproved 6.3 (2004 June 7, compiled [...] 2005). When reading .sh shell scripts there is no problem, though.

It doesn't recognize html files for syntax highlighting. Is there any to force a particular language interpretation even if the editor doesn't recognize it? In emacs, M-x html-mode informs the editor what language you're actually editing.

I can't upgrade because this is running in servers.

share|improve this question
up vote 1 down vote accepted

Assuming Vim is installed correctly the command is :set filetype=html, see :help filetype for more information.

You can shorten it to :set ft=html.

Happy retro-vimming!

share|improve this answer
Thanks for the information! It works. – Vlueboy Oct 7 '11 at 21:50

You can force vim to use the language you want with

:setf html


share|improve this answer
Thanks, 10 months later I've noticed "setf" is easier to type. I ended up automating the original issue via custom definitions based on extensions: – Vlueboy Aug 15 '12 at 3:14

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.