Setting a Language for vim Syntax Highlighting

One can force the language for vim syntax highlighting with
:setf language
Examples
For C:
:setf c
For PHP:
:setf php
For XML:
:setf xml

One can force the language for vim syntax highlighting with
:setf language
For C:
:setf c
For PHP:
:setf php
For XML:
:setf xml
February 4th, 2009 at 11:15 pm
Was looking for precisely this information, thanks.
I Have some code in files without file extensions, so I need to manually specify the language otherwise there is no highlighting.
February 4th, 2009 at 11:34 pm
So did I.
Glad this helped.
March 12th, 2009 at 7:45 pm
Cheers, just what I needed!
March 12th, 2009 at 8:37 pm
Great! You’re welcome.
September 1st, 2009 at 8:28 pm
Thanks for the info, spot on!
May 11th, 2010 at 9:42 am
Thanks a bunch!