Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

2 Answers

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
add comment

You can force vim to use the language you want with

:setf html

See

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: vimdoc.sourceforge.net/htmldoc/filetype.html#new-filetype –  Vlueboy Aug 15 '12 at 3:14
add comment

Your Answer

 
discard

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.