
One can force the language for vim syntax highlighting with
:setf languageExamples
For C:
:setf cFor PHP:
:setf phpFor XML:
:setf xml
Update: An Alternative
In the comments below, Vladimir wrote:
Another way is :set filetype=language
Simple executing :set filetype will show current language used for syntax highlighting.
Thanks for the additional information.
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.
So did I.
Glad this helped.
Cheers, just what I needed!
Great! You’re welcome.
Thanks for the info, spot on!
Thanks a bunch!
over 2 years later, and still a good find! Thanks!
Thanks, I was just editing a xml config without xml headers or file extension so it wouldnt detect the syntax, :setf xml works.
Yaay!
Thank you very much for this. Exactly what I needed.
Thanks!
WOW !!!!
Great help !!
Thanks for sharing!
Another way is :set filetype=language
Simple executing :set filetype will show current language used for syntax highlighting.
Exactly what I wanted. Thanks
Thanks for the tip, Vladimir. I’ll update the post.
Thanks for the help it was very useful
later