Sep 14, 2018

Forcing Syntax Coloring for files in Vim

If you are editing a file containing PHP script (for example) but the file doesn't have the extension .php, you can force the desired syntax coloring with :set syntax=php. similarly :set syntax=perl :set syntax=html. Alternatively if the extension causes an undesired coloring, switch off coloring with :set syntax=off