How to Turn On Syntax Highlighting in Vim/Vi Editor
Table of Contents
Turn On Syntax Highlighting in Vim/Vi Editor
Vim is one of the popular text editors among the software developers & system administrators. The macOS as well as on different Linux Distros Vim comes preinstalled. We can edit code in Vim easily. But the syntax is not highlighted by default in Vim. In this tutorial, you are going to learn How to Turn On Syntax Highlighting in Vim/Vi Editor.
Turn On Syntax Highlighting in Vim
helloworld.c file by using the following command. (We have taken here
helloworld.c as a demo file you can open any program file.)
Esckey to come in normal mode if you are in any other mode.
The enter following command and hit
The output should be:
Turn On Syntax Highlighting in Vim Permanently
We can set syntax highlighting permanent by editing
~/.vimrc file. To do this run the following commands:
.vimrc file using the following command:
Now append the following text in the above-opened file and then save the file:
Here you have successfully enabled syntax highlighting permanently in Vim.
Turn Off Syntax Highlighting in Vim
You can turn off syntax highlighting by using the following command inside Vim:
In this tutorial, you have learned How to Turn On Syntax Highlighting in Vim/Vi Editor. If You have any queries regarding this please comment below.
How to Add Swap Space on CentOS 8
How to Add Swap Space on Debian 9
How to Setup UFW firewall on Debian 9
How to Install MySQL on Linux Mint 19
How to Install PhpStorm on Manjaro 18
How to Install WordPress with LEMP Stack on Ubuntu 18.04
How to Install WebStorm on CentOS 7
How to install XAMPP on Debian 9
How to Install Gradle on CentOS 8
How to install LAMP stack on CentOS 7
How to install LEMP Stack on Ubuntu 18.04
Secure Apache with Let’s Encrypt SSL on Debian 9