Turning on XML syntax highlighting in vim for a non-XML file
Solution 1:
The command you want is ":setfiletype
". For example:
:setf xml
See ":help :setfiletype
".
Solution 2:
You can place this in your ~/.vimrc file as well
au BufNewFile, BufRead *.extension_name set filetype=xml
Replace extension_name with the extension you want, reopen vim, and you will see xml syntax highlight.
Solution 3:
Expanding on @RubyFanatic answer, what worked for me was (in vim
's command mode):
au BufNewFile,BufRead *.extension_name setf xml