Enable vim Syntax Highlighting

I have to admit, I’m addicted to vim. There are many cool editors out there, but I still not used to them. Now, that I discovered how to enable vim syntax highlighting I decided to share some details.

First, I want to thank you for your support with my ITPro Helper shop. I’m going to add more cool inspiring T-Shirts and coffee mugs designs during this month.

After brewing a great cup of coffee from Panama I decided to put together this little tutorial. This instructions should work for any Linux distro or macOS. Just run this command to make sure you have vim installed:

vim -version

There are hundred of options to vim out there. I’m just going to concentrate on a few in this post.

Open any script to check vim syntax highlighting

For example I’m working on this Flask/Python file, I opened to check vim syntax highlighting:

vim app.py
.py file view in vim

In my case I already enabled vim syntax highlighting on this file by running this command while having the file opened with vim:

:syntax on

If you want you can turn it OFF:

:syntax off

You will need to do this every time you open your file. But, if you like to make this changes permanent in vim you will need to edit or create a .vimrc file in your home directory:

vim ~/.vimrc

Now, all you need to enter your desired vim options line by line. For example:

syntax on

Save it and that’s all!

If you like to set your syntax highlighting specific to a language then you can for example set it to python:


But, you can set it to other languages: perl, php, awk and etc..

Leave a comment

Your email address will not be published. Required fields are marked *