Sometimes I write scripts without the usual extension “.sh” or “.scr” as some people do. I am also writing this blog post on vim on just a text file. But i use html tags on it. I don’t like the text file to have the “.html” extension on it. So i manually turn on the syntax highlighting. Vim also picks up the syntax from the shebang line, but this is for cases when even that isn’t present.
Pretty simple this one.
:set syntax=html or what ever your code is. Done!