Vim – Manual Syntax Highlighting

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!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s