I'm using vim to browse through some log files (the file extension is .log) which contain a lot of XML.

How can I turn on XML syntax highlighting after opening the file? Of course, I don't actually want to associate XML syntax highlighting with all log files.

link|improve this question
feedback

1 Answer

up vote 1 down vote accepted

The command you want is ":setfiletype". For example:

:setf xml

See ":help :setfiletype".

link|improve this answer
Beautiful, this is exactly what I was looking for. Thanks! – Mansoor Siddiqui Jan 27 at 22:42
feedback

Your Answer

 
or
required, but never shown

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