Just tell Vim to first recognize the filetype which its opening and perform the syntax highlighting.
Open the vim configuration file
Create a new file ".vimrc" if this doesn't exist. And add the following lines to the file:
Then save and quit, restart your vim, it should be working now.
The same should be working in linux as well.